I have read posts and watched a video on youtube but just when I think it makes sense I can't apply it AT ALL.

Here is what I'm looking to do. In column G have a list of unique customer numbers from Sales Invoice Lines so I use this: =NL("Rows","Sales Invoice Line","Sell-to Customer No.","Sell-to Customer No.","<>''","Salesperson Code",\$C\$2)

Now in Column H I want to sum up all the Sales Invoice lines so I use this: =NL("Sum","Sales Invoice Line","Amount","Sell-to Customer No.",\$G14)

But I want my results to be sorted in decending order by the sum (column H)

I have tried so may different variations of imbedded NL functions and quoted functions but my brain hurts.....any help would be appreciated.

• Bryan Robinson

=@NL("Rows","Sales Invoice Line","Sell-to Customer No.","-=NL(""Sum"",""Sales Invoice Line"",""Amount"",""Sell-to Customer No."",NF(,""Sell-to Customer No.""),""Salesperson Code"",\$C\$2)","*","Salesperson Code",\$C\$2)

Sort by Sum (or count) with Dynamics NAV – Support Topics (jetglobal.com)

• Tim Kirby

Bryan, THANK YOU!

I finally understand after looking at the link you provided. Working with what you proved and the link I was able to work through an error about having a blank sell-to customer number.

Long story short in case anyone finds this and is confused like me because my brain wasn't catching what was going on and no one really explains this that I saw. In your Rows function you are going to be doing the work of getting your customer number AND sorting, the sum that you are displaying in the column to the right is just displayed by a normal function. In my brain I was missing this piece...hopefully it helps someone else.