Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
hawk
Contributor II
Contributor II

Getting last 20 Dates irrespective of selections

HI, 

 

I am trying to get the last 20 Dates as bar chart dimension. 

I am trying this formula. 

=aggr(Only({1<ReportDate={">=$(=FirstWorkDate(Max(ReportDate),20))"} >} ReportDate),ReportDate)

 

Since, I am using "1" as set identifier, I was assuming it should return the last 20 dates irrespective of date filter but, it is still returning it based on date selected only. So, my current selection is 1 Jun to 15 Jun, so it is returning dates from 1 Jun to 15 Jun only. and the result is same when I change the set identifier to "$". 

5 Replies
sunny_talwar

May be try this

=Aggr(
  Only({1<ReportDate={">=$(=FirstWorkDate(Max({1} ReportDate), 20))"}>} ReportDate)
, ReportDate)
hawk
Contributor II
Contributor II
Author

Thanks Sunny,

 

I tried this but still no luck. It still shows the same date range

sunny_talwar

Are you using this as an expression or dimension?

hawk
Contributor II
Contributor II
Author

Dimension

 

I am trying to get the last 20 Dates as bar chart dimension

hawk
Contributor II
Contributor II
Author

Ok. I have found out the problem. So, seems like my initial formula was correct but I needed to add {1} in measures to get those measure values irrespective of selection. After I have added the {1}, the formula is working as intended

Thanks Sunny and sorry for wasting your time