Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

alphabetical rank restricted to a set

Hi all

I need to restrict a rank function that gives me alphabetic order to a set of rows, I can achieve this with other expressions by using set analysis but not this expression:

rank([Field 1],4)

e.g. if I have a table like:

Field 1Field 2
A10
B20
C30
D40
E50

I use set analysis like {<[Field 2]-={30}>}

this restricts the table correctly for other expressions but in the expression for rank as above I get 1,2,4,5, when I want 1,2,3,4....?

If anyone can help I'd really appreciate it.

Thanks

Dominic

1 Solution

Accepted Solutions
sunny_talwar

Seems to be working, not sure what you mean. Do you not get this output?

Capture.PNG

View solution in original post

6 Replies
sunny_talwar

Seems to be working, not sure what you mean. Do you not get this output?

Capture.PNG

maxgro
MVP
MVP

maybe

only({$ <[Field 1]-={"=rank([Field 1],4)<=1"}>} [Field 1])

Not applicable
Author

Hi

I wasn't using Only!  I always forget that one - when you need a set and no aggregation.

Thanks

Dominic

sunny_talwar

where else were you using {<[Field 2]-={30}>}. Rank doesn't allow for a set expression.

So is the issue resolved now? I am confused

Best,

Sunny

Not applicable
Author

Yes, I have other expressions in the table that allow for the set expression but couldn't think how to apply the set to the rank - like I say I infrequently use the only function.  Thanks.

sunny_talwar

No problem. I am glad I was able to help.

Best,

Sunny