Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
paddy64
Contributor
Contributor

Rank in title expression

 

Hi everybody, anybody knows how to give the rank of a value on the title?

Ex : Sales of 9 countries (below) , England is the 3rd. I  want to put on the bar chart title : "England 's ranking is the 3rd"  

Country / Sales

France / 6

England / 10

New Zealand /13

Italy / 12

Spain /3

Portugal /7

USA /9

Australia /6

Japan / 5

Indonesia / 8

 

Thank you in advance for the precious help

1 Solution

Accepted Solutions
PV
Contributor II
Contributor II

Hi,

Is it Ctry England is always fixed and you want to show only the dynamic rank of England in your title?
If so, then you can use below expr.
='England ''s ranking is the '& aggr(if(CTRY='England',Rank(sum(Sales))),CTRY)&'rd'
Else if, your requirement is to always show third highest sales country then use below expr.
='Country having 3rd highest sales is -'& FirstSortedValue(CTRY, aggr(Rank(sum(Sales))=3,CTRY))

View solution in original post

4 Replies
PV
Contributor II
Contributor II

Hi,

Is it Ctry England is always fixed and you want to show only the dynamic rank of England in your title?
If so, then you can use below expr.
='England ''s ranking is the '& aggr(if(CTRY='England',Rank(sum(Sales))),CTRY)&'rd'
Else if, your requirement is to always show third highest sales country then use below expr.
='Country having 3rd highest sales is -'& FirstSortedValue(CTRY, aggr(Rank(sum(Sales))=3,CTRY))

View solution in original post

paddy64
Contributor
Contributor
Author

Hi PV, it's been 4 days since i was on this expression and you saved me!! Thank you so much it's working!!!

paddy64
Contributor
Contributor
Author

Hi PV, as I said previously thak so much for help it worked perfectly. The answer to your question was yes it's always England fixed but the second expression will help me anyway. Tell me, how can i had an other dimension eg City as a condition in the expression below?
aggr(if(CTRY='England',Rank(sum(Sales))),CTRY)
PV
Contributor II
Contributor II

Hi Paddy,
Glad that helped you!! Reg city : Suppose you have 4 cities under England, you need to get rank for particular city under England? Something like below?
aggr(if(CTRY='England' and City ='Cambridge' ,Rank(sum(Sales))),CTRY,City)