Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Update Posted Sales Transactions

Posted on by Microsoft Employee

I am trying to update the posted sales transactions fact table in my cube , the values comes from Navision's Value Entry Table  [Sales Amount(Actual) and Cost Amount (Actual) , below is the columns in the screenshot.
I have pasted data from NAV next to my pivot as you can see in the screenshot , the budget is fine , the budget script I used to update the costs where there is FOBB (Export Costs) is

 UPDATE [dbo].[Sales Budget Transactions_V]
 SET [Cost Amount] = ([Cost Amount] + [Sales Costs])
 WHERE [Item Charge No_] = 'FOBB'

 UPDATE [dbo].[Sales Budget Transactions_V]
 SET [Sales Costs] = 0
 WHERE [Item Charge No_] = 'FOBB'

  UPDATE [dbo].[Sales Budget Transactions_V]
 SET [Sales Costs FCY] = 0
 WHERE [Item Charge No_] = 'FOBB'


For actuals I have copied the same budget script , however I have altered the columns according my actuals. When I add the sales amount , or sales costs , or sales costs(actuals) my data disappears in my cube report as you can see in the screenshot

My script for actuals is

UPDATE [dbo].[Posted Sales Transactions_R]
 SET [Sales Amount] = ([Sales Amount] + [Sales Costs (Actual)])
 WHERE [Item Charge No.] = 'FOBB'

 UPDATE [dbo].[Posted Sales Transactions_R]
 SET [Sales Amount] = 0
 WHERE [Item Charge No.] = 'FOBB'

  UPDATE [dbo].[Posted Sales Transactions_R]
 SET [Sales Costs FCY] = 0
 WHERE [Item Charge No.] = 'FOBB'


I really don't know what I am doing wrong , and don't know how to get the data in the sales costs , sales support and actual sales amount field , where there is 'FOBB'

item-charges-for-actuals.JPG

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update Posted Sales Transactions

    Vishal my update query is wrong , I have changed it and are testing to see if it will return any results

  • Suggested answer
    Alex A Profile Picture
    Alex A 2,348 on at
    RE: Update Posted Sales Transactions

    Try using ISNULL() wherever you are doing addition, because 10 + NULL = NULL

    (ISNULL([Sales Amount], 0) + ISNULL([Sales Costs (Actual)], 0))


  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update Posted Sales Transactions

    As I can see, you are updating the values to zero for following two fields.

    UPDATE [dbo].[Posted Sales Transactions_R]

    SET [Sales Amount] = 0

    WHERE [Item Charge No.] = 'FOBB'

     UPDATE [dbo].[Posted Sales Transactions_R]

    SET [Sales Costs FCY] = 0

    WHERE [Item Charge No.] = 'FOBB

    How do you set the value of Sales Cost or Actual Sales Amount field? Can you provide your SQL query for the same.

  • Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Update Posted Sales Transactions

    I just want to make sure there is data where item charge is FOBB

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update Posted Sales Transactions

    I did there is data in my table , what are you suggesting

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Update Posted Sales Transactions

    Try Select * from Posted Sales Transactions WHERE [Item Charge No_] = 'FOBB'

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Update Posted Sales Transactions

    Data do exist if I do a select * from Posted Sales Transactions

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Update Posted Sales Transactions

    Did you try using select statement first and check if data exists in those columns.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans