0

Sort on the average sales by country

Hi,

Maybe this has been covered somewhere else, but my searches don't come up with a solution…..

I want a report that shows the average sales per country. So far so good….
But I want it sorted by average sales. And that is something else….

I get my data from the Customer table.
Basic report shows at least 4 columns:
Country codes (cell C6): =NL("Rows";"Customer";"Country code")
Number of customers per country (cell H6): =NL("Count";"Customer";"No.";"Country code";C6)
Total sales per country (cell I6): =NL("Sum";"Customer";"Balance ($)";"Country code";C6)
Average (cell J6,excel formula): =I6/H6
That works fine, but….

I like to have the report sorted on column J, the excel formula.

When I try to implement the seperate Jet-functions in one Filterfield value I get errors.

First I tried to sort on only the number of customers by replacing C6 with:
=NL("Rows";"Customer";"Country code";"-=NL(""Count"";""Customer"";""No."";""Country code"";NF(;""Country code""))";"*")
Works like a charm!

Same for sorting on total sales, C6 will be:
=NL("Rows";"Customer";"Country code";"-=NL(""Sum"";""Customer"";""Balance ($)"";""Country code"";NF(;""Country code""))";"*")
No trouble at all.

But when I try to use both as a Filterfield value something breaks.
When C6 contains this:
=NL("Rows";"Customer";"Country code";"-=Local(NL(""Count"";""Customer"";""No."";""Country code"";NF(;""Country code""))/NL(""Sum"";""Customer"";""Balance ($)"";""Country code"";NF(;""Country code"")))";"*")
the report is sorted by country code.
Removing the Local() statement returns errors.

What am I missing? Or why won't this work?

Any help is greatly appreciated.

rmw

3 comments

Please sign in to leave a comment.