Hi everyone,
I am writing a report to look at the top ten customers outstanding items on current sales orders on backorder status:
=NL("Rows","Customer",,"Blocked","<>All","-=NL(""Sum"",""Sales Line"",""Outstanding Amount (LCY)"",""Document Type"",$B$2,""Bill-to Customer No."",NF(,""No.""),""No."",$B$5,""Outstanding Quantity"",""<>0"",""Link="",""Sales Header"",""No."",""=Document No."",""Order Status"",$B$3)","*","Limit=",10)
(Below is to shorten the NL function to under 255 chars:)
- B2: Order
B3: On Back Order
B4: Item
B5:
=NL("Filter","Item","No.","Category","A|B","Blocked",FALSE)
B5 is aimed at only considering Sales Lines where the Item on the line belongs to Categories "A" or "B" ('Category' is a field on the Item table).
My problem is that the Filter in B8 slows the report down to over 12 minutes! Leaving this filter out completely has the report running at under a minute!
Is there any way I could optimise this filter or the NL function itself?
FYI, below are the keys on the Sales Line table, if they are of any use:
Enabled Key SumIndexFields
Yes Document Type,Document No.,Line No. Amount,Amount Including VAT,Outstanding Amount,Shipped Not Invoiced,Outstanding Amount (LCY),Shipped Not Invoiced (LCY)
Yes Document No.,Line No.,Document Type
Yes Document Type,Type,No.,Variant Code,Drop Shipment,Location Code,Shipment Date,Deleted Outstanding Qty. (Base)
Yes Document Type,Bill-to Customer No.,Currency Code Outstanding Amount,Shipped Not Invoiced,Outstanding Amount (LCY),Shipped Not Invoiced (LCY),Return Rcd. Not Invd. (LCY),Return Rcd. Not Invd.
No Document Type,Type,No.,Variant Code,Drop Shipment,Shortcut Dimension 1 Code,Shortcut Dimension 2 Code,Location Code,Shipment Date Outstanding Qty. (Base)
No Document Type,Bill-to Customer No.,Shortcut Dimension 1 Code,Shortcut Dimension 2 Code,Currency Code Outstanding Amount,Shipped Not Invoiced,Outstanding Amount (LCY),Shipped Not Invoiced (LCY)
Yes Document Type,Blanket Order No.,Blanket Order Line No.
Yes Document Type,Document No.,Location Code
Yes Document Type,Shipment No.,Shipment Line No.
Yes Type,No.,Variant Code,Drop Shipment,Location Code,Document Type,Shipment Date
Yes Document Type,Sell-to Customer No.
Yes Job Contract Entry No.
Yes Document Type,Document No.,Bin Code
Yes Type,No.,Variant Code,Drop Shipment,Location Code,Bin Code,Document Type,Shipment Date
Yes Sort Bin
Yes Type,No.
I am using Jet Reports 2010 R2 with NAV 5.0 SP1 Update 2. Have used Jet Reports since version 7, and have not seen anything like this before. It should be easy, shouldn't it? :evil:
Thanks guys and gals!
Stephen