Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
wale_martins
Contributor III
Contributor III

RANK ISSUE WHEN USING TWO DIMENSION VALUES

Hi there,

I have a problem when using a rank function in a straight table. The thing is that I want to rank the first top 13, taking into consideration two dimension values (TRACKING,TAG).

My problem comes when there's a duplicate TAG but with different TRACKING. It seems like if my rank expression, it's only taking into consideration the top 13 TAG values (without caring the TRACKING dimension) to create the ranking.

TAG 13.png

So in that case, appear the top 13 TAG values (Formacion and Jornada Formacion Anestesia are duplicated) but not the 13 top TRACKING,TAG values.

DIMENSIONS:


TRACKING;

TAG


EXPRESSIONS:


COUNT TAGS => IF(AGGR(RANK(COUNT(DISTINCT ID_VISITA),4),TRACKING,TAG)<=13,AGGR(COUNT(DISTINCT ID_VISITA),TRACKING,TAG))

Any help would be appreciated.

Thanks!!

Wale

1 Solution

Accepted Solutions
sunny_talwar

Does this look right?

Capture.PNG

I used this

IF(AGGR(RANK(TOTAL COUNT(DISTINCT ID_VISITA),4),TRACKING,TAG)<=13,AGGR(COUNT(DISTINCT ID_VISITA),TRACKING,TAG))

View solution in original post

6 Replies
thevingo
Creator
Creator

1. Can you take both Tag & Tracking by concating as dimension, then use in AGGR formula as you've given then hide that dimension/column from Presentation tab.

Formula can be IF(AGGR(RANK(COUNT(DISTINCT ID_VISITA),4),TRACKING&TAG)<=13,AGGR(COUNT(DISTINCT ID_VISITA),TRACKING,TAG))


2. Or I think you can try rank before aggr Rank(Aggr

wale_martins
Contributor III
Contributor III
Author

Hi Govind,

1. I need both dimension values  as dimension (Filtering issue). Concating and adding TAG as an expression AND TRACKING as an expression it's not viable in that case...

2. It doesn't work...

Thank you for your time!

sunny_talwar

Your Count seems to be a really small number... is it possible that they are all getting ranked the same and hence not getting picked?... would you be able to share a sample to look at this in detail?

wale_martins
Contributor III
Contributor III
Author

Hi Sunny!

The problem appear when there is a duplicated TAG.... For example, If we do not take into consideration the TRACKING dimension, the rank is correct. It picks only 13 values... the problem appears when I try to add TRACKING as dimension and there is a repeated TAG....



sunny_talwar

Does this look right?

Capture.PNG

I used this

IF(AGGR(RANK(TOTAL COUNT(DISTINCT ID_VISITA),4),TRACKING,TAG)<=13,AGGR(COUNT(DISTINCT ID_VISITA),TRACKING,TAG))

wale_martins
Contributor III
Contributor III
Author

Genious!!!  I don't know how many hours I've wasted trying to do the trick!! 5 Sunny minutes and it's solve!

Thank you very much!!!