Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
silvia_assuncao
Creator
Creator

Ranking max top 5

Hi,

I need some help selecting the top 5 costs, but I'm having some problem because it's returning negative values also, but I want only values great then zero to return..

The result shoud be as below:

Could you please help me?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think it's just an issue with how you use your variable, see attached.

View solution in original post

12 Replies
swuehl
MVP
MVP

Maybe use one of the approaches shown in attached sample

antoniotiman
Master III
Master III

See attachment

silvia_assuncao
Creator
Creator
Author

Hi! both solutions worked.

Now I'm tryin to create the same ranking using a variable, but it's not returning any vaue. could you please help me with this last one?

Sum({<[Unique Account ID] = {"=Rank  ,0)<=5"}>} ($(vTotal_Cost)) )

swuehl
MVP
MVP

Sorry, I don't understand what you are trying to achieve.

The expression looked like e.g.

=Sum({<[Unique Account ID] = {"=Rank(RangeSum(Sum({<[Adjust Type]={C},[Registry ID] = {70},[Adjust Signal]={-}>}[Adjust Amount]*(-1)),

Sum({<[Adjust Type]={C}, [Registry ID] = {70}, [Adjust Signal]={+}>} [Adjust Amount])),0)<=5"},[Adjust Signal]={'+'}>} [Adjust Amount])

What's the definition of your variable? If you want to replace the field with a variable, you would need to do this in every place it show up.

silvia_assuncao
Creator
Creator
Author

Hi! I've created a variable for the total cost, and then I did create the ranking as dimension. but I see that not all values are the 5 greatest.

below the values which should be the top five:

top 5.PNG

I'm also attaching here the qvw

swuehl
MVP
MVP

I think it's just an issue with how you use your variable, see attached.

Not applicable

see the attachment. I built another version with the correct top 5

Is it ok for your necessity?

silvia_assuncao
Creator
Creator
Author

Hi Swuel, I cannot find your new attachement here... could you please uplad it here again? thanks

swuehl
MVP
MVP

Please find attached.