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: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Dynamic previous month end date script

Hello, I want my date field to be equal to the previous month last day and it should be stored in a variable.

Then I want to use that variable in my visualization by passing month number and no of days as parameters.

Example - My variable stores the sum of weight where my Date is picking the previous month last day, then I want to use that variable in my visualization like $(mYvariable(12,31,0)) which will give me the sum of weight on 31st Dec.

If i pass $(mYvariable(11,30,0)) it should give me for Nov.

1 Reply
brunobertels
Master
Master

Hi 

create new variable in script or in the variable panel menu ; add this mesure 

monthend(addmonths(max(Your_Date_Dim),-1))