Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with using Rank / Aggr

Hello everyone,


I have a list box with an expression that is supposed to show a mini trendline covering data from the last 4 weeks (below).

trendline.JPG

Unfortunately, the expression I am using to extract the values for the last 4 weeks is not working.... The underlying data is shown in the table on the left, however my expression:

=Aggr(If(Rank(DashboardDate) <=4, [Total Logged Last Week]) ,[Total Logged Last Week])

appears to be bringing back the data shown on the right.

I would like to bring back only the top 4 dates (sorted descending) and their corresponding values - can someone help me see where I am going wrong?

DashboardDate.JPG

Thanks in advance!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try a dimension DashboardDate and as expression

=Sum({<DashboardDate = {">=$(=Date(Max(DashboardDate,4),'DD/MM/YYYY'))"} >} [Total Logged Last Week])

View solution in original post

4 Replies
swuehl
MVP
MVP

Try a dimension DashboardDate and as expression

=Sum({<DashboardDate = {">=$(=Date(Max(DashboardDate,4),'DD/MM/YYYY'))"} >} [Total Logged Last Week])

ramoncova06
Specialist III
Specialist III

you can use an advanced search to get the top 4 weeks

sum({< DashboardDate ={"=rank(Sum(Total Logged Last Week])) <= 4 "}>}[Total Logged Last Week])

Anonymous
Not applicable
Author

This didn't work unfortunately 😞

Anonymous
Not applicable
Author

Perfect!! Thanks!!