Yep, not the highest performance setup, it was significantly improved in 2009 and 2013 though and these tables were done away with,
My suggestion to customers running pre-2009 R2 systems it to at least upgrade the application to 2009 r2 it is a pretty simple upgrade and the performance improvement is noticeable in most cases
The easiest explanation of the calculation is the actual NAV sum code (Think of it as the query code for the field inside of NAV)
Sum("Purchase Line"."Outstanding Qty. (Base)"
WHERE (Document Type=CONST(Order),
Type=CONST(Item),
No.=FIELD(No.),
Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),
Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),
Location Code=FIELD(Location Filter),
Drop Shipment=FIELD(Drop Shipment Filter),
Variant Code=FIELD(Variant Filter),
Expected Receipt Date=FIELD(Date Filter)))
I formatted this first one to make it easier to understand, The filter fields are used internally by NAV when it wants a total by key fields so ignore them for your code, the bold bit is the important bit
Here is the sales one:
Sum("Sales Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),Type=CONST(Item),No.=FIELD(No.),Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),Location Code=FIELD(Location Filter),Drop Shipment=FIELD(Drop Shipment Filter),Build Kit=FIELD(Build Kit Filter),Variant Code=FIELD(Variant Filter),Shipment Date=FIELD(Date Filter)))
Hope this makes sense?
Nev