Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
MEBG93
Creator
Creator

set analysis when max(date, 2) not working when selecting a different date

Hello everyone,

I have an issue on a set analysis date selection, I want to select the penultimate date available. It only works without any filters applied, but it stops working when a different date is selected. The expression goes like:

=COUNT({< [DATE]={'$(=MAX(DATE,2))'}>}operation_id)

PD: it works perfectly (with and without filters) when looking for actual date (max(date))

 

Thanks!

Labels (3)
11 Replies
sunny_talwar

All it is doing is to look at the Max Date which is less than the Max date selected

=Max({<DATE = {[<$(=Max(DATE))]}>}DATE)

So, the inner set analysis is saying look at all DATEs less than Max(DATE)...So, Max date less then the actual max(DATE) will be your second max date.. you can also use this

 =Max({<DATE = {[<=$(=Max(DATE))]}>}DATE, 2)

Now, I added <=... so to find the second max date, you will need to add the 2 at the end.... 

MEBG93
Creator
Creator
Author

Very useful !