Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
DanielleW1
Contributor II
Contributor II

Ignore selection in Aggr rank statement

I have a heatmap where I am displaying customers sales per week where it ignores the week selection and displays for example every week in the year. 

This part is working fine, however I want to colour by a measure which ranks the sales per customer per week and colours depending on this. I have done this previously on another app, but this time I don't want the users to manually have to select all weeks for the colours to display properly.

I have tried something like this, but not having any luck:


={1<Week = P(${Week})>}Aggr(RANK({1<Week = P(${Week})>}aggr((sum({1<Week = P(${Week})>}[Sales])*-1), [Customer Name]),0,0), [Customer Name])

 

The one I have on another app which works when they select the relevant weeks is:

Aggr(Rank(Aggr((SUM([Sales])*-1), [Customer Name],[Week]), 0, 0), [Customer Name],[Week])

 

Below shows the issue where the user has selected week 8 and therefore it is the only coloured cell.

Screenshot 2023-11-09 114936.png

Labels (4)
1 Reply
Aasir
Creator III
Creator III

Try this, I removed redundant set analysis within the Rank function since you already have set analysis at the beginning of the expression. Also, make sure that the field names and data model match your actual setup.

Aggr(
Rank(
aggr(
sum({1<Week = P(Week)>}[Sales]) * -1,
[Customer Name]
),
0,
0
),
[Customer Name]
)