If you are unable to create a new account, please email support@bspsoftware.com

 

Rank Function for a Measure and two data items Customer + Sales Regions

Started by Kevin.Ja, 17 Jul 2015 05:31:17 AM

Previous topic - Next topic

Kevin.Ja

Hello all,

I am working on a report where I have added a filter to show the top X customers which is working fine so far and the user can select at the prompt page if he wants to see the top 10, 20, 50 etc.

The data model is relational.

The rank function I have used for the customer overview page is
rank ([Line Price Total] at [Customer Number - Bill-to])

Additional I have a page in the report which shows the data by sales rep/region and I have some trouble to add a similar rank function for this page.
The page should show the top X customers per sales rep but applying the same logic at the rank function shows only the total top X customers assigned to the according sales rep and not the e.g. top 10 of the single sales reps.

As this is logical because the above rank function does pick up the total top X customers I have tried to extend the function to get the desired result
rank([Line Price Total] at [Customer Number - Bill-to] for [Sales Rep])

This gives a result where I get ten customers per sales rep but this are not the top 10 regarding the selected measure (revenue) of the special sales rep. They are sorted descending according to the rank but this doesn't match with the value of the measure (revenue) for the single sales rep.
For some sales reps the result is fine but for others not. May it be possible that the total of the measure for the customer is used for the rank function and not the total of the customer for the single sales rep?
It looks like if the customer has orders at different sales reps then the value for the rank seems to come from the total revenue of the customer even if he has only small revenue for this special sales rep.

Example for the current retrieved ranking
Rank - Customer - Measure (Revenue)
1 - XXX - 5.000
2 - YYY - 20.000
3 - ZZZ - 16.000

I hope I have described it understandable?

Could you please help me on this topic and explain what I have to change at the rank function to ensure that I get the top X customers regarding the revenue measure for every single sales rep?

Thanks in advance for your help!
Kevin