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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank Query

Hi all,

i have below table:

Client     Product     pnl

1          eq               100

2          fi                  50

3         com               50

4          eq               150

5          fi                  500

1          fi                  200

2          com             50

now i want to build a straight table with all 3 columns and add total expression as per client pnl as 4th column and rank as 5th column as rank should be on overall client as per pnl. example below

client          product     pnl     totalpnl     overall rank

1               eq             100     300          2

2               fi               50       100          4

3               com          50        50          5

4               eq             150     150           3

5               fi               500     500           1

1               fi               200     300           2

2               com          50        100          4

do let me know how to get Overall Rank column, as thats what i am not getting. rest columns i can derive

aprpeciate yoru help

thanks

Sukhwant


10 Replies
anbu1984
Master III
Master III

Define variable vProd=GetFieldSelections(Product)

Change expressions to

If(IsNull(vProd) Or Product=vProd,pnl)

If(IsNull(vProd) Or Product=vProd,Sum(TOTAL<Client> pnl))

If(IsNull(vProd) Or Product=vProd,Rank(TOTAL Sum(TOTAL<Client> pnl),1,1))

Create New alternate state and set that to your chart