Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

HRank Problem

I'm using QlikView 10 and can't get the HRank expression to work.  I've attached a view of the column headings which shows the expressions I'm using.  I'm using a pivot table, but the only result that I get with the HRank expression is a dash.  What am I doing incorrectly?

1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

Ah, I see. Sorry, I just assumed since hrank() is used comparatively less frequently than rank().

Back to your question, that's not what function hrank() does. Hrank() is used in pivot table to rank when a dimension has been pivoted across the top. It ranks horizontally, but only within the same pivoted dimension. In your case, you will need to create the expression manually, using IF statements. For example: if(column(1)>column(3),1,2)

In your case, this will be more complex since you have multiple expressions.

Regards,

Vlad

View solution in original post

6 Replies
vgutkovsky
Master II
Master II

Are you sure you want hrank and not a regular rank() function? Try using rank(sum([6 Benefits]),4,1)

Regards,

Vlad

Anonymous
Not applicable
Author

Yes, I do want to rank the rows (horizontal) versus the columns.  In my example, I'm expecting the rank to be 2 and then 1 per row.  (In reality, I have more columns to rank instead of just two.)  I can't understand why my expressions can rank vertically but not horizontally (all I get are null values).  Any other suggestions?

vgutkovsky
Master II
Master II

Ah, I see. Sorry, I just assumed since hrank() is used comparatively less frequently than rank().

Back to your question, that's not what function hrank() does. Hrank() is used in pivot table to rank when a dimension has been pivoted across the top. It ranks horizontally, but only within the same pivoted dimension. In your case, you will need to create the expression manually, using IF statements. For example: if(column(1)>column(3),1,2)

In your case, this will be more complex since you have multiple expressions.

Regards,

Vlad

vgutkovsky
Master II
Master II

Another option is something like the attached.

Regards,

Vlad

Anonymous
Not applicable
Author

Vlad, thanks so much for your response.  Unfortunately, I'm using the personal edition of QlikView so I cannot see your recent attachment.  Regardless, I appreciate your help!

vgutkovsky
Master II
Master II

Basically, the attachment has a calculated dimension something like this: valuelist('Expression 1','Expression 2') which was pivoted across the top. And 2 expressions:

Value

pick(match(valuelist('Expression 1','Expression 2'),'Expression 1','Expression 2'),

     sum(Exp1),

     sum(Exp2)

)

Rank

hrank(Value)