I have a Top N report that ranks customers by their sales volume for the specified time period. The report has a parameter that lets the user pick whether to see all customers or only a certain number - i.e. only the top 10.
I have all the running totals working great so that my 'grand total' is actually a running total of the top 10 included in the report.
My issue is that I now need to a ratio calculation of the running total at each customer level to the running grand total for the number of customers selected. If only 5 customers are selected, I need the ratio to be based on total sales for those 5 customers. If all customers are selected, the ratio will be based on total sales for all customers.
Example:
Total sales for all customers is $150,000. Total sales for the top 10 customers is $100,000. Example:
Customer 1 $28,000 Running Total $28,000 28% of total
Customer 2 $23,000 Running Total $51,000 51% of total
Customer 3 $18,000 Running Total $69,000 69% of total
Customer 4 $15,000 Running Total $84,000 84% of total
Customer 5 $ 5,000 Running Total $89,000 89% of total
Customer 6 $ 3,000 Running Total $92,000 92% of total
Customer 7 $ 2,000 Running Total $94,000 94% of total
Customer 8 $ 2,500 Running Total $96,500 96.5% of tot
Customer 9 $ 2,000 Running Total $98,500 98.5% of tot
Customer 10 $ 1,500 Running Total $100,000 100% of total
If the user selects to show ALL customers, the running total for all is $150,000, and the % calculation needs to be done on the ratio of the running total at that customer's level to the grand running total - i.e. $28k/$150k, $51k/$150k, etc.
I can't find a way to make the percentage work. Any suggestions? Thanks in advance for the help.
I have all the running totals working great so that my 'grand total' is actually a running total of the top 10 included in the report.
My issue is that I now need to a ratio calculation of the running total at each customer level to the running grand total for the number of customers selected. If only 5 customers are selected, I need the ratio to be based on total sales for those 5 customers. If all customers are selected, the ratio will be based on total sales for all customers.
Example:
Total sales for all customers is $150,000. Total sales for the top 10 customers is $100,000. Example:
Customer 1 $28,000 Running Total $28,000 28% of total
Customer 2 $23,000 Running Total $51,000 51% of total
Customer 3 $18,000 Running Total $69,000 69% of total
Customer 4 $15,000 Running Total $84,000 84% of total
Customer 5 $ 5,000 Running Total $89,000 89% of total
Customer 6 $ 3,000 Running Total $92,000 92% of total
Customer 7 $ 2,000 Running Total $94,000 94% of total
Customer 8 $ 2,500 Running Total $96,500 96.5% of tot
Customer 9 $ 2,000 Running Total $98,500 98.5% of tot
Customer 10 $ 1,500 Running Total $100,000 100% of total
If the user selects to show ALL customers, the running total for all is $150,000, and the % calculation needs to be done on the ratio of the running total at that customer's level to the grand running total - i.e. $28k/$150k, $51k/$150k, etc.
I can't find a way to make the percentage work. Any suggestions? Thanks in advance for the help.