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: 
Not applicable

Ranking a subset of a larger dataset based on a threshold value


Hi All

I'm new to QlikView so am sure I'm going about this all wrong... and I'm pretty sure this same question has been asked before... but I'm trying to use the rank function to create, then rank a subset of a larger dataset based on a threshold value.  Something like this:

if(IsNum(field),if(field >= 17, rank(field),'LT 17')) 

The numbers I'm ranking range from 0-25 and there are 96 unique entities in my list i.e. I'm not trying to aggregate  / sum based on an identifier.  Below is a subset of the result :

ID                field      Rank

blah 61        1.00      LT 17

blah 33        16.00    LT 17

blah 80        19.00    19-31

blah 3          15.00    LT 17

blah 77        19.00    19-31

blah 90         21.00    7-18

blah 68         12.00    LT 17

blah 65         13.00    LT 17

blah 28         21.00    7-18

blah 7          13.00     LT 17

blah 3          19.00    19-31

blah 71        18.00    32

blah 13          9.00    LT 17

blah 41        17.00    33-36

blah 14         4.00     LT 17

blah 71         4.00     LT 17

blah 91         5.00     LT 17

blah 58                      -

I also want the rank values to remain when I select / filter the subset i.e. not apply only to the filtered list

At present the ranking is starts at 5 rather than 1.  Also the rank gives a range rather than a unique value e.g. 5-6 - how do I specify a unique rank?

Thank you for any help,

Ross

2 Replies
Not applicable
Author

Should have added I'm doing this in an expression within a field in a Chart  / Straight Table

sunny_talwar

Are you trying to do this in the script or front end???