Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
We value your feedback – take our 5-minute QlikView modernization survey
cancel
Showing results for 
Search instead for 
Did you mean: 
jocampbell
Creator
Creator

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])

jocampbell
Creator
Creator
Author

This didn't work unfortunately 😞

jocampbell
Creator
Creator
Author

Perfect!! Thanks!!