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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rank grouped by

Hello,

I have the following table:

CategoryMarketBrandModelValueDesiderata
A1B1M111
A1B1M211
A1B2M311
A2B1M111
A2B2M311
B1B2M322
B2B1M222
B2B2M322
C1B1M132
C1B1M232
D1B1M143
E2B2M353
F1B2M363
F2B2M364
G2B1M172
G2B2M375

I would like to obtain the "Desiderata" column in which i rank "Value" grouping by "Market", "Brand" and "Model"

I tried to use the following:

Aggr(NODISTINCT Rank(TOTAL  -GlobalRank) ,Market,Brand,model)

but i have all null values.

Do you have any suggestions?

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Maybe like

=Num(Aggr(NODISTINCT Rank(TOTAL  -Value) ,Market,Brand,Model,Value))

View solution in original post

6 Replies
swuehl
Champion III
Champion III

What is GlobalRank? Is this the Value field?

You should use aggregation functions in the aggr() expression whenever there is more than one possible Value for a Market, Brand, Model combination, which is the case here. So you need to decide how you want to aggregate the Value field values.

It's unclear to me how you derive the Desiderate values from Value field, so if you want to get more help, I believe you need to add more info about your setting and requirements.

Not applicable
Author

Yes I'm sorry, GlobalRank is the Value column.

The value column represent a global rank of category: A -> 1, B->2, etc.

What I would like to obtain is the rank of the Category partioned by Market, Brand and Model.

For this reason I do not have to aggregate the value column since it is a rank itself.

For example if I select a market 1, brand B1 and model m1 I would like to have the following:

Value     Desiderata

     1               1

     3               2

     4               3

Hope I've been clearer now.

Thanks for your help.

swuehl
Champion III
Champion III

Maybe like

=Num(Aggr(NODISTINCT Rank(TOTAL  -Value) ,Market,Brand,Model,Value))

Not applicable
Author

Almost. I think we're close to the solution. The problem now  is that when I select market model and brand I can see the right rank, but when I deselect all, the rank changes. How is it possible to keep the same rank values even when all dimensions are not selected?

Thanks again.

swuehl
Champion III
Champion III

remove the TOTAL qualifier from the Rank() function.

Not applicable
Author

It works great!!!! Thanks!!!!