Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

ranking rows

Dears

got a pivot table with one dimension and sorted by an expression

actually there are two expressions

I'm sorting the results based on the values of the first expression Descending

Now for the second expression I get the following values let's say

100%

95%

80%

95%

100%

70%

...

what I want is add a third expression and rank the results of the second expression as follows:

100%         1

95%           2

80%           3

95%           2

100%         1

70% .....

Please advise

I can walk on water when it freezes
7 Replies
Anonymous
Not applicable

add third expression and use

Rank(second expression)

ali_hijazi
Partner - Master II
Partner - Master II
Author

I tried it

but I got 100% for 278 rows and on the second values less than 100% the rank is giving me 279

I can walk on water when it freezes
ali_hijazi
Partner - Master II
Partner - Master II
Author

I want to have 2 instead

I can walk on water when it freezes
sunny_talwar

What formula are you using to calculate %? Is it some kind of aggregate function?

Best,

S

ali_hijazi
Partner - Master II
Partner - Master II
Author

no aggr

the thing is that rank is displaying same rank value for similar results i.e. for the values 100% suppose I got 2 rows with 100% the rank displays 1 for each row, however if the value is 95% which is the first value just below 100% , the rank displays 3 instead of 2

I can walk on water when it freezes
robert_mika
Master III
Master III

What does your first expression look like?

Could you attached your file?

ali_hijazi
Partner - Master II
Partner - Master II
Author

look at the example given in the help when you press F1 in QlikView client

the rank function works as the document is behaving in my case

is there a way to give custom ranks?

I want to give rank to the first x lines in the pivot table where x is specified by the user

I can walk on water when it freezes