Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rkpatelqlikview
Creator III
Creator III

How to show RANK in Text object

Hi All,

Can anyone please explain how to show the rank in text object. When i selected the name in the selection box then the Current Rank  it should display in one Text Object and and previous rank in one more text object.

Below is the formula for ranking which is i used in Straight Table.

23.PNG

Thanks

KUMAR

25 Replies
rkpatelqlikview
Creator III
Creator III
Author

Hi Youssef,

Not actually. Name only is the selection. I am thinking that can we store the Previous Rank to particular variable and call that variable in to the Text object?

rkpatelqlikview
Creator III
Creator III
Author

Hi  Youssef,

Hope you are doing great!

Please help me on the below expression to display the Rank in the Text object.

=

Aggr(

rank(

(Round(sum({<[Safety Category]={'Green'}>} [Kms Travelled]) / sum([Kms Travelled]) *100)/4)

+(Round((COUNT(DISTINCT [DEVICE NO]) -COUNT([Device Number]))/COUNT(DISTINCT  [DEVICE NO]) *100 )/4 ) +

(Round(SUM({<controlled={'Yes'}>}Quantity)/SUM({<controlled={'Yes'}+{'No'}>}Quantity)*100)/4)

+

(Round(SUM({<[iVMS ( Y/N)]={'Yes'}>}Quantity)/SUM({< [iVMS ( Y/N)]={'Yes'}+{'No'}>}Quantity)*100)/4)+sum([Kms Travelled])/(1E10)

,4,1), [Carrier Name])

thanks in advance

YoussefBelloum
Champion
Champion

Hi,

everything is going well thank you

assuming all your calculations are correct iside your expression, try this:

=Aggr(

rank(

(Round(sum({<[Safety Category]={'Green'},[Carrier Name]>} [Kms Travelled]) / sum({<[Carrier Name]>}[Kms Travelled]) *100)/4)

+(Round((COUNT(DISTINCT {<[Carrier Name]>}[DEVICE NO]) -COUNT({<[Carrier Name]>}[Device Number]))/COUNT(DISTINCT  {<[Carrier Name]>}[DEVICE NO]) *100 )/4 ) +

(Round(SUM({<controlled={'Yes'},[Carrier Name]>}Quantity)/SUM({<controlled={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)

+

(Round(SUM({<[iVMS ( Y/N)]={'Yes'},[Carrier Name]>}Quantity)/SUM({< [iVMS ( Y/N)]={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)+sum({<[Carrier Name]>}[Kms Travelled])/(1E10)), [Carrier Name])

rkpatelqlikview
Creator III
Creator III
Author

Excellent Youssuef,  many Thanks  for your great support.

YoussefBelloum
Champion
Champion

You're welcome Kumar

rkpatelqlikview
Creator III
Creator III
Author

HI Youssuef,

Am able to show the rank in Text object. Meanwhile i need to show Denominator out of no. Carriername.

Ex: There are 15 Carrier Names. Out of 15, the Carrier Rank is 5/15. How can i show this Denominator  "15"

=Aggr(

rank(

(Round(sum({<[Safety Category]={'Green'},[Carrier Name]>} [Kms Travelled]) / sum({<[Carrier Name]>}[Kms Travelled]) *100)/4)

+(Round((COUNT(DISTINCT {<[Carrier Name]>}[DEVICE NO]) -COUNT({<[Carrier Name]>}[Device Number]))/COUNT(DISTINCT  {<[Carrier Name]>}[DEVICE NO]) *100 )/4 ) +

(Round(SUM({<controlled={'Yes'},[Carrier Name]>}Quantity)/SUM({<controlled={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)

+

(Round(SUM({<[iVMS ( Y/N)]={'Yes'},[Carrier Name]>}Quantity)/SUM({< [iVMS ( Y/N)]={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)+sum({<[Carrier Name]>}[Kms Travelled])/(1E10)), [Carrier Name])

Thanks for your support

YoussefBelloum
Champion
Champion

Hi,

try this:

=Aggr(

rank(

(Round(sum({<[Safety Category]={'Green'},[Carrier Name]>} [Kms Travelled]) / sum({<[Carrier Name]>}[Kms Travelled]) *100)/4)

+(Round((COUNT(DISTINCT {<[Carrier Name]>}[DEVICE NO]) -COUNT({<[Carrier Name]>}[Device Number]))/COUNT(DISTINCT  {<[Carrier Name]>}[DEVICE NO]) *100 )/4 ) +

(Round(SUM({<controlled={'Yes'},[Carrier Name]>}Quantity)/SUM({<controlled={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)

+

(Round(SUM({<[iVMS ( Y/N)]={'Yes'},[Carrier Name]>}Quantity)/SUM({< [iVMS ( Y/N)]={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)+sum({<[Carrier Name]>}[Kms Travelled])/(1E10)), [Carrier Name])&' / '&Count(total [Carrier Name])

rkpatelqlikview
Creator III
Creator III
Author

Thanks Youssef,

Its working overall. But here i have 5 groups. If i select any CarrierName it should give the rank and outof how many carriers in that Group. It should compare with in the group. I used below one. Please correct it. Nominator Group Rank is coming but Denominator is not working.

=Aggr(

rank(

(Round(sum({<[Safety Category]={'Green'},[Carrier Name]>} [Kms Travelled]) / sum({<[Carrier Name]>}[Kms Travelled]) *100)/4)

+(Round((COUNT(DISTINCT {<[Carrier Name]>}[DEVICE NO]) -COUNT({<[Carrier Name]>}[Device Number]))/COUNT(DISTINCT  {<[Carrier Name]>}[DEVICE NO]) *100 )/4 ) +

(Round(SUM({<[Control_Fleet (Y/N)]={'Yes'},[Carrier Name]>}Quantity)/SUM({<[Control_Fleet (Y/N)]={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)

+

(Round(SUM({<[iVMS ( Y/N)]={'Yes'},[Carrier Name]>}Quantity)/SUM({< [iVMS ( Y/N)]={'Yes'}+{'No'},[Carrier Name]>}Quantity)*100)/4)+sum({<[Carrier Name]>}[Kms Travelled])/(1E10)), Group,  [Carrier Name])&' / '&Count(total  {<[Carrier Name]>} Group)

rkpatelqlikview
Creator III
Creator III
Author

Thanks Youssef, Got it.

YoussefBelloum
Champion
Champion

Sorry Kumar, I was going back to you to get more details..happy to see that is it working for you