Sort by Sum - descending

Hi there,

I searched the forum for sorting by sum. Lots of info but I guess I'm not at the level to understand it, yet. Here's what I have:

C4: =NL("Rows","Item","Customer Group","No.",NL("Filter","Item Ledger Entry","Item No.","Entry Type","Sale"))
E4: =-NL("Sum","Item Ledger Entry","Quantity","Entry Type","Sale","Posting Date",HIDDEN!$F$10,"Item No.",NL("filter","Item","No.","Customer Group",$C4))
F4: =-NL("Sum","Item Ledger Entry","Quantity","Entry Type","Sale","Posting Date",HIDDEN!$E$10,"Item No.",NL("filter","Item","No.","Customer Group",$C4))
G4: =-NL("Sum","Item Ledger Entry","Quantity","Entry Type","Sale","Posting Date",HIDDEN!$D$10,"Item No.",NL("filter","Item","No.","Customer Group",$C4))

I'm pulling the sum of all sales from 2009 through this year so i can put them on a chart. E4 is 2009 and so on. What I need to show on the chart is the top 5 customers with the most sales. As it sits, the report runs in ascending order by customer group. I'd like for it to run in descending order by the sum for each year or by the sum of all 3 years together. This way, I'll be able to limit the records in a query to 5 customers in order from greatest amount of sales to least. I haven't a clue on how to do this with what I have now. Ideas?

Sorry if this has been covered before.




Please sign in to leave a comment.