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

Select date range in button

Hi,

I have a button selecting all months and years where the date >= (today - 14 days) - and I wanna add the days to this selection.

The calculations I'm using is as below:

  • if(CalendarMonth = Month(Today()), CalendarMonth,
         if(CalendarMonth = month(Today()-14), CalendarMonth)) for months
  • if(CalendarYear= year(Today()), CalendarYear,
         if(CalendarYear = year(Today()-14), CalendarYear)) for years

To select the days I'm using if(CalendarDay<= Day(Today()), CalendarDay, if(CalendarDay>= Day(Today()-14), CalendarDay)), which gives me (as for today) 22 - 5. But the problem here is that it gives me 1-5 of nov and oct - which isn't correct according to date >= (today - 14 days)

Is there another way to write the calculation so that I can get the correct days for each month? It should work with the question below...

Another thing that is included to this discussion is:

I have an calendar in the application, the users want to use this "Last 14 days" button to get the latest data, but they also want to be able to add more days/months/years to the selection by choosing from the days/months/years fields. How can I make this work with the button above?

Thanks ahead!

0 Replies