Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

rank

Can we rank based on each dimension

for example.: I have a straight table with Cyclic Dimension and Sales Amount.My cyclic Dimension has the following below dimension.

Product

Product ID

Country

Sales Person

..

few more

So for example if i select Product | Sales Amount -- > The Sales amount should be ranking based on the top sold product

If i select Sales Person -------->The Sales amount should be ranking based on the top sales done on the Sales person

once i change the dimesnion it should be able to rank it.. i have totally 7-8 dimesnions which i would rank..

14 Replies
Anil_Babu_Samineni

Have you tried any expression or better approach if you share more information

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vinieme12
Champion III
Champion III

Create a variable to capture your group selection

say,

VGroupselection  = GetCurrentField([GroupFieldName]) 

Now use this variable to aggregate your Rank expression

AGGR(Rank() , $(VGroupselection ) )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

This is the same of what I just explained!

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
adamdavi3s
Master
Master

ha it is, sorry I was obviously writing up as you posted. I'll remove my answer

vinieme12
Champion III
Champion III

oh no, I was expecting to see  another method

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
adamdavi3s
Master
Master

haha no, yours is by far the best way I would say, I was just too slow in creating my QVW

sunny_talwar

Not sure I understand the use of Aggr() function here?

Why can't we just use Rank(Sum([Sales Amount])) here? I mean as the dimension changes, the Rank() would automatically be based on the dimension we are seeing, why do we need to add Aggr() here? Sorry, if I missed something important detail here

adamdavi3s
Master
Master

I think I just assumed there would be more than one dimension in the table

sunny_talwar

I guess my concern here is that what is the use of naked Aggr() function. We don't need to for sorting also, so just not sure why would need it even if we have multiple dimensions