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

Creating a variable for month end dates for the past year

I need to create a variable to use in a for loop to execute a stored procedure. The variable needs to hold the last date of every month going back one year from Today(). Is this possible?

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

yes.

try something like below

let vMonthdates ='';
for i=1 to 12
	vMonthdates=vMonthdates &','&MonthEnd(addmonths(today(),-1*i))
next;