Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pepe2209
Creator
Creator

Select last 31 days with action button

Hello,

I thought this would be easy but I can't get it to work:

I have the variable 'Startdate' and with one click on an action button i want to select only the dates within the last 31 days.

I tried the action select in field with field 'Startdate' and value: =if(Startdate>=today()-31, '*')

but this does not work.

The only other way i can think of is creating a new field in the script 'Lastmonth' with 1 for each 'Startdate' within the last month. But i rather not add another variable to an already large dataset and application.

is it possible to do this without a extra field?

your help would be much appreciated.

Regards

Peter

1 Solution

Accepted Solutions
Nicole-Smith

Select in Field: Startdate with the expression:

='>=' & date(today()-31) & '<=' & today()

View solution in original post

5 Replies
Nicole-Smith

Select in Field: Startdate with the expression:

='>=' & date(today()-31) & '<=' & today()

Michiel_QV_Fan
Specialist
Specialist

Peter,

Do you need the last 31 days prior to the selected date, or, do you need the current month or do you need the previous month?

pepe2209
Creator
Creator
Author

@Nicole Thanks this works!

pepe2209
Creator
Creator
Author

Hello

I actually want both, the last 31 days prior to today, and the previous month. The first one is already fixed thanks to Nicole. Now I'm trying to figure out the second one

pepe2209
Creator
Creator
Author

Ok now I use  this:

='>=' & MonthStart(today(),-1) & '<=' & MonthEnd(today(),-1)

for selecting all dates in the previous month