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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hrank

how does the hrank works???

thanks.

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Hi

First, it only works in Pivot tables, which is I suppose obvious when you know what it does.

A pivot obviously takes one expression and can create many columns according to the dimension you use (date for example) and the HRank function gives you a ranking of the current cell within the row of the same expression.

Consider the following:

You have country as the vertical pivot dimension.

You have month as the horizontal pivot dimension.

You have Sum(Sales) as one Expression

You have Sum(Cost) as another expression

Your pivot is therefore showing sales and cost by month across the screen and by country down the screen.

If you now add another expression such as HRank(Sum(Sales)) then that will give you the ranking of that months sales, the parameters are the same as those for Rank so you can get the results customised to what you want to see.

EG (in one Row): Jan=1000, Feb=2000, Mar=1500, Apr=3000, May=6000, Jun=500

HRank(Sum(Sales)) for each of the above would give you: May=1, Apr=2, Feb=3, Mar=4, Jan=5, Jun=6

Hope this helps,

View solution in original post

1 Reply
Not applicable
Author

Hi

First, it only works in Pivot tables, which is I suppose obvious when you know what it does.

A pivot obviously takes one expression and can create many columns according to the dimension you use (date for example) and the HRank function gives you a ranking of the current cell within the row of the same expression.

Consider the following:

You have country as the vertical pivot dimension.

You have month as the horizontal pivot dimension.

You have Sum(Sales) as one Expression

You have Sum(Cost) as another expression

Your pivot is therefore showing sales and cost by month across the screen and by country down the screen.

If you now add another expression such as HRank(Sum(Sales)) then that will give you the ranking of that months sales, the parameters are the same as those for Rank so you can get the results customised to what you want to see.

EG (in one Row): Jan=1000, Feb=2000, Mar=1500, Apr=3000, May=6000, Jun=500

HRank(Sum(Sales)) for each of the above would give you: May=1, Apr=2, Feb=3, Mar=4, Jan=5, Jun=6

Hope this helps,