web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Historical Physical Inventory (InventSumDateEngine Vs InventValueReportView)

(0) ShareShare
ReportReport
Posted on by 395

I am attempting to create a report that will break out historical costs by category. I am having a hard time understanding how the InventSumDateEngine works vs the InventValueReportView. I have been able to make the report work using the InventSumDateEngine and then calculating on hand using the records it returns. The issue with this is it takes awhile. Using the date engine with 1 item takes about 2 minutes to give me a result, but I noticed that what the date engine is doing is somewhat similar to what is already happening in the InventValueReportView. If I can utilize this view to calculate on hand at a point in time it would be much faster. What is confusing to me is if this is possible why would base AX not utilize the same view for the physical inventory by dimension and inventory value reports? Clearly to calculate inventory values at a point in time the inventory value report provided in base must calculate physical amounts? Regardless...is there a way to calculate on hand at a point in time using the InventValueReportView? If so types of postings should I include in the select statement to get this value?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Brandon Wiese Profile Picture
    17,788 on at

    InventSumDateEngine isn't designed to calculate a historical on-hand for a single item.  If you look through the code, you can see that it's built and optimized to calculate for every item at the same time using set based operations.  You can probably get the answer for every item in the same time you're using it to just get one item.  

    Also InventSumDateEngine cares about additional quantities, such as Picked and Registered, that are useless to InventValueReportView, because those quantities do not have any ledger effect and the Inventory value report is focused primarily on your "accounting on-hand", i.e. the on-hand quantity that ties to your ledger inventory balance accounts.

    The InventValueReportView, because it's a view, can be filtered on ItemId and SQL Server will happily apply that filtering to the source tables, which translates to a huge reduction in work done to arrive at an answer.  So, of course InventValueReportView is faster to calculate a single item.

  • Verified answer
    Brandon Wiese Profile Picture
    17,788 on at

    I found the question about InventValueReportView interesting, so I did some playing around with it.

    InventSum can be tied back to InventTrans quite easily, since the current balance for any item, both in terms of quantity and value, is always the sum of all transactions in its history.  Of course, InventSum only exists for Released products of type Item (not Service), and InventTrans records that are estimated, i.e. On order, Ordered, Picked, etc., do not contribute to the "accounting" on-hand quantity or value found in InventSum.

    Still, I wondered if the InventValueReportView was a faithful transaction breakdown of historical inventory.

    I found the following two queries to produce identical results in a substantial environment with multi-year history.

    First, a summary of InventSum to determine the total quantity and value of inventory.

    SELECT 
        s.[PARTITION], 
        s.DATAAREAID, 
        SUM(s.POSTEDQTY + s.RECEIVED - s.DEDUCTED) AS QTY, 
        SUM(s.POSTEDVALUE + s.PHYSICALVALUE) AS AMOUNT
      FROM INVENTSUM s
      GROUP BY s.[PARTITION], s.DATAAREAID
      ORDER BY 1, 2

    Then, a summary of InventValueReportView to determine the same.

    SELECT 
        v.[PARTITION], 
        v.DATAAREAID, 
        SUM(v.QTY) AS QTY, 
        SUM(v.AMOUNT) AS AMOUNT
      FROM INVENTVALUEREPORTVIEW v
      JOIN INVENTTABLE i ON i.[PARTITION] = v.[PARTITION] 
                        AND i.DATAAREAID = v.DATAAREAID 
                        AND i.ITEMID = v.ITEMID
      WHERE v.TRANSDATE <> CAST(N'21541231' AS DATETIME)
        AND i.ITEMTYPE = 0
      GROUP BY v.[PARTITION], v.DATAAREAID
      ORDER BY 1, 2

    Note the filter to ItemType of 0 (Item) to exclude the inventory transaction history for ItemType of service which do not contribute to InventSum.  Also note the exclusion of TransDate of 12/31/2154 which appears to include some weighted average adjustments.  Some research into how that works is probably warranted.

    These queries tie-out to each other precisely for the current on-hand quantity and value.

    In theory, and I'll be testing this some more, if you just add a filter on TransDate for InventValueReportView, you should be able to arrive at a quantity and value for the balance as of that date.

  • Brandon Wiese Profile Picture
    17,788 on at

    I tried to tie-out InventValueReportView using 12/31/2015 against another report that provides "as of" data, and while the answers were very close, they were not precise.  I suspect that InventSettlement records are not being properly accounted for in InventValueReportView.  It might still be a useful if not precise way to produce historical summary data.

  • Lars Nordin Profile Picture
    on at

    I tried to do the very same, but I'm confused since I thought Picked and Registered are also part of on-hand, which then gives me a problem since Registered and Picked don't have a DatePhysical or DateFinancial.

    Would you mind checking out my question here and help clarifying things. I'd really appreciate it!

    community.dynamics.com/.../211301

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans