# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
cancel
Showing results for
Did you mean:
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.

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
MVP

Does this look right?

I used this

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

6 Replies
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

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...

MVP

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?

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....

MVP

Does this look right?

I used this

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

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!!!