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

Button Action to Select last 3 Full Months

Hi,

In my load script I am creating these variables :

vLast3MonthStartDate=Monthstart(today(),-4);

vLastMonthEndDate=MonthEnd(Today(),-1);

I have a date field in my data called [Date]

I am trying to select the last 3 full months of data using this action on a button click :

= '>=' & $(vLast3MonthStartDate) & '<=' & $(vLastMonthEndDate)

But it doesn't seem to select anything.

I am clearing Date as the first action

Can anyone help?

Thanks,

Phil

3 Replies
Anil_Babu_Samineni

Try this?

= '>=' & vLast3MonthStartDate & '<=' & vLastMonthEndDate

Or

= '>=' & $(=vLast3MonthStartDate) & '<=' & $(=vLastMonthEndDate)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
qlikviewwizard
Master II
Master II

Capture.PNG

Capture.PNGHi Try like this:

SUM({< DATE={"$(='>=' & $(vLast3MonthStartDate)& '<=' & $(vLastMonthEndDate))"}>}SALES)

sushil353
Master II
Master II

hi,

Check your date field format and your variable format. you can change the format using date function..

vLast3MonthStartDate=Date(Monthstart(today(),-4));

vLastMonthEndDate=Date(MonthEnd(Today(),-1));