Qlik Community

Third-Party Qlik Jobs

Area for people to learn more about current Qlik related job postings.

Highlighted
paddy64
New 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
New Contributor II

Re: Rank in title expression

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))
4 Replies
PV
New Contributor II

Re: Rank in title expression

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))
paddy64
New Contributor

Re: Rank in title expression

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
New Contributor

Re: Rank in title expression

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
New Contributor II

Re: Rank in title expression

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)