Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
KNRaju105630
Partner - Contributor II
Partner - Contributor II

Rank should not be change when user select

Hi Community,

below is my table, I have calculated RANK - but when user select any product changing the RANK, but it should not change the RANK (if user select or not)

LOAD * INLINE [
Category, Sub Category, Product, Sales
Mobiles, Nokia, N1, 12
Mobiles, Nikia, N2, 2
Mobiles, Samsung, S1, 25
Mobiles, Samsung, S2, 7
Mobiles, Samsung, S3, 7
Mobiles, IPhone, I++, 9
Books, Qlik, QlikView, 5
Books, Qlik, ABC, 30
Books, Qlik, BCA, 30
Books, Qlik, XYZ, 30
Books, Qlik, XAB, 30
Books, Qlik, ABG, 30
Books, Tableau, Tab, 10
Books, Spotfire, SF, 8
];

KNRaju105630_0-1680078870376.png

Thanks in advance!

Labels (1)
3 Replies
KNRaju105630
Partner - Contributor II
Partner - Contributor II
Author

@tresesco ..

Anyone can help please - bit urgent!

LucasBarbosa
Partner - Contributor II
Partner - Contributor II

Hello @KNRaju105630 

A simple way to do this is:

  1. Use the aggr graph function (The Aggr function is used for nested aggregations, in which its first parameter is calculated once per dimensional value);
  2. Use TOTAL for the calculation to be done in all possible values;
  3. Use the identifier 1 in the set analysis to receive all the expression data regardless of the filter used;

 

Resulting in the following expression:

aggr(rank(total sum({1} Sales),1,2),Product)

 

Without any filter:

 

LucasBarbosa_1-1680093775635.png

 

With product filter = S2:

LucasBarbosa_3-1680093936314.png

 

reading references:

1 - Rank()

2 - TOTAL

3 - Aggr()

 

 

 

 

 

 

 

Marcos112
Partner - Contributor III
Partner - Contributor III

Hello Everyone,

Hello Lucas, 

 

Do you know , how can i do the next?

I think it's a simple query, I need to count the dates, I'm using the rank function that gives me the expected result, the problem is when I filter by a date, the rank returns to 1, so I need it to ignore the selection of that field(Fecha)

 

Thanks in advance

Marcos112_0-1680200194521.png