0

Sort by multiple NLs?

Hi,

I'm hoping someone can help me out with this formula before I throw my laptop out of the window :)

I have written a jet report which shows invoiced sales (sales year to date) by customer in 1 column, then booked sales (sales for the rest of the year that haven't been invoiced yet) in another column, then a total in a third column.
I had to mess about a bit with the VAT in the booked sales column, as I was using Outstanding Amount field which includes VAT, and I wanted it excluding VAT.

At the moment, every time the report is run, I need to manually sort it by the total. I would like to see if it is possible to build the sort bit into the customer list, so it would show list of customers, sorted by (sum of invoiced sales + sum of booked sales).

Here is my attempt:
=NL("Rows","Customer","No.","Customer Posting Group","FOB","-=(NL(""Sum"",""Value Entry"",""Sales Amount (Actual)"",""Source No."",NF(,""No.""),""Posting Date"","""&$F$4&""")+(NL(""Sum"",""Sales Line"",""=IF(NF(,""VAT %"")>0,(NF(,""Outstanding Amount (LCY)"")/1.2),NF(,""Outstanding Amount (LCY)""))"",""Source No."",NF(,""No.""),""Posting Date"","""&$F$1&""")))","*","Link=","Value Entry","Source No.","=No.","Link=","Sales Line","Sell-to Customer No.","=No.")

I am getting a #VALUE! error and it says it can't evaluate the formula, and I think if I keep messing about with it myself I'm just going to make it worse!

Any help would be appreciated.

5 comments

Please sign in to leave a comment.