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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help on Rank function

Hi,

Can somebody help me with the rank function in the below scenario.

I have a crosstable with the following columns:

code
MeasureTypeValue
ABCTurnover3000
ABCMarketshare3000
ABCRanking3000
PQRTurnover2500
PQRMarketshare2500
PQRRanking2500
XYZTurnover3200
XYZMarketshare3200
XYZRanking3200

I am looking to provide the following information for code ABC:

MeasureType
Value
Turnover3000
MarketShare34.48 (3000/(3000+2500+3200)*100
Ranking2 (3200 is 1st, 3000 is 2nd and 2500 is 3rd)

With Measure type as dimension i am able to acheive Turnover and Marketshare. but not able to acheive the Ranking column. can somebody help me with this.

Thanks in advance

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think it could be just

rank(sum(Value))

I used code and MeasureType as dimensions and a pick(match()..) combination as expression to create the measures per MeasureType. Please see also attached.

View solution in original post

3 Replies
swuehl
MVP
MVP

I think it could be just

rank(sum(Value))

I used code and MeasureType as dimensions and a pick(match()..) combination as expression to create the measures per MeasureType. Please see also attached.

Not applicable
Author

thanks swuehl....it work for me...but cant figure out how you made the dimension (MeasureType) as columns...

swuehl
MVP
MVP

It's a pivot table with the dimension pivoted to the top:

Click on "MeasureType" in the graph and move your mouse around while keeping button pressed. You'll see a blue line indicating the new position of the dimension.