Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

avantime
Contributor

Top x % with rank

Hi,

I have a request that sounds like this.. We need a table that shows:

-top 20% (out of the total number of rank A clients) rank A clients sorted by total sales.

-top 30% (out of the total number of rank B clients) rank B clients sorted by total sales.

-top 50% (out of the total number of rank C clients) rank C clients sorted by total sales.

Any thoughts on how I should approach this?

Thanks!

1 Solution

Accepted Solutions
pkukkonen3
New Contributor II

Re: Top x % with rank

Sounds pretty much like this:

Recipe for a Pareto Analysis

And this:

Recipe for an ABC Analysis

For rank you need to use Aggregate:

https://help.qlik.com/en-US/sense/3.0/Subsystems/Hub/Content/ChartFunctions/aggr.htm

I had to come up with the expression which calculates the rank recently and it's something like this:

aggr(rank(sum({<Customer.Name= >} sales)), Customer.Name)

Unfortunately I can't share the whole solution.

7 Replies

Re: Top x % with rank

Can you provide some sample data with the expected output?

avantime
Contributor

Re: Top x % with rank

Sure, it should look something like:

ClientClient rankTurnover
Client2321321A99999
Client3123A99998
Client32432B999
Client342323B998
Client344335B997
Client2454B996
Client84332311B995
Client946743C99
Client32420C98

Re: Top x % with rank

Hahaha, is this sample data or expected output?

avantime
Contributor

Re: Top x % with rank

This is the expected output, as you asked.

I have 2 issues.

- how to get the top x% of clients with the same rank.

- how to show them in a table, one after another, sorted by rank and turnover.

pkukkonen3
New Contributor II

Re: Top x % with rank

Sounds pretty much like this:

Recipe for a Pareto Analysis

And this:

Recipe for an ABC Analysis

For rank you need to use Aggregate:

https://help.qlik.com/en-US/sense/3.0/Subsystems/Hub/Content/ChartFunctions/aggr.htm

I had to come up with the expression which calculates the rank recently and it's something like this:

aggr(rank(sum({<Customer.Name= >} sales)), Customer.Name)

Unfortunately I can't share the whole solution.

vikasmahajan
Honored Contributor III

Re: Top x % with rank

Hope this helps you

Vikas

avantime
Contributor

Re: Top x % with rank

Great answer, this really helped a lot, thank you very much.

Community Browser