Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show ranking for selected product(s)

Hi guys,

I would like to display a rank for a selected product. What I have now is a table with the Dimension 'productname' and a measure like that: 'rank(sum(SALES))' . What that does without filtering is to show me the ranks for each product nicely in a table. But as soon as I filter on a productname I always get Rank 1 for that product. Which makes sense of course, but what I need is that the measure shows me the actual rank for the product. Can someone help me on that?

Best regards

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Rank(Sum({1} SALES)) * Avg(1)


UPDATE: Fixed the expression to add the missing parenthesis after the OP pointed out.

View solution in original post

7 Replies
sunny_talwar

Try this:

Rank(Sum({1} SALES)) * Avg(1)


UPDATE: Fixed the expression to add the missing parenthesis after the OP pointed out.

Not applicable
Author

hey, thanks for the quick reply,

unfortunately this still shows me rank 1 for every selected product 😕

sunny_talwar

Are you sure you added {1} to the sum(sales) expression?

Not applicable
Author

yeah Im sure, I just copy pasted what you posted and added a bracket, which seems to miss?

So: Rank(Sum({1} SALES) * Avg(1)) is what i used.

This is what I get with your suggestion:

QlikCapture.jpg

Sense still seems to make a new ranking based on what I filter on 😕

EDIT: Ok I see... I put the bracket at the wrong position. My bad and thank you!

Not applicable
Author

One more question:

Is it possible to display this rank as a KPI ? Whats the syntax for that? It doesnt seem to work for the same syntax

Again, thank you very much

abhijain
Partner - Contributor III
Partner - Contributor III

Hi sunny,

This expression is working fine.

Can you please explain how avg(1) is working.

sunny_talwar

So you can try this, but this will display a comma separated list of all ranks when you haven't selected a single productname.

Concat(Aggr(Rank(Sum({1} SALES)) * Avg(1), ProductName), Chr(10))

If you only ever want to see this when you have only one selected, then may be this:

Only(Aggr(Rank(Sum({1} SALES)) * Avg(1), ProductName))