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


1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Sum(TOTAL<Client> pnl)

Rank(TOTAL Sum(TOTAL<Client> pnl),1,1)

139406.png

View solution in original post

10 Replies
sorrakis01
Specialist
Specialist

Hi,

Try this:

Rank(TOTAL SUM(pnl))

Regards

anbu1984
Master III
Master III

Check this app

rustyfishbones
Master II
Master II

Try

AGGR(SUM(pnl),Client) for the Total for Client

and add

AGGR(RANK(SUM(pnl)),Client) for their ranking

Not applicable
Author

no developer license

sorry

Not applicable
Author


refer attached. this is what i get in F column

Not applicable
Author

total column i already got and is as per expectation

your rank formula gives me '-' in all the rows


anbu1984
Master III
Master III

Sum(TOTAL<Client> pnl)

Rank(TOTAL Sum(TOTAL<Client> pnl),1,1)

139406.png

Not applicable
Author

Hi Anbu,

thanks this works for rank perfect , but now the challenge is if one selects a Product in list box like " fi"  the rank column changes as per the proct selected, but i would like the rank to be shown as per the table you mentioned above

how is that possible

thanks

Anonymous
Not applicable
Author

Rank(TOTAL Sum(TOTAL<Client> pnl),1,1)