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

button for last week and last month

Hello all,

 

for button use i created the variable vDate which is just my [date] field.

I passed it to the KPI i want to use with these buttons.

I created one for today like : date(floor(max([date])), 'DD/MM/YYYY')

and for yesterday like: date(floor(max([date]-1)), 'DD/MM/YYYY')

 

BUT i'm having trouble with last week and last year.

For last week  i though >=(date(floor(max([date])), 'DD/MM/YYYY')-7)<=date(floor(max([date])), 'DD/MM/YYYY')

 

but doesn't work ... Help me please!

1 Reply
morgankejerhag
Partner - Creator III
Partner - Creator III

Hi, I am not sure what you mean by the date field in your variable - a field contains multiple values and a variable only contains a single value. Do you want the date range to be selected when a user clicks the button? If so, then add an action that selects a range of values in a field, select your date field and write an expression like ='>$(=date(today()-7))<=$(=date(today()))'

The default date format must be the same as in the Date field for it to work.

Morgan Kejerhag
Senior Business Intelligence Consultant
Drake Analytics
http://www.drakeanalytics.se