Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LastDateOfMonth

Hello

I have to create a date spawn from 20000101 to last date in current year and month(period) 3

My result have to be: 20130331

I have year field and a period field to get data from, but i don't have the last date in the month (period)

I how can i assign this value to a variable "LastDateInPeriod)?

GunnarSchie

1 Solution

Accepted Solutions
Gysbert_Wassenaar

If you want to create the variable in the script you can use

SET vMyLastdateofMonth = monthend(makedate(MyYear, MyMonth));

You can also create the variable in the Variable Overview window by clicking on the Add button and entering a name for the variable. After you've created the variable select it in the Variables list and then enter the expression in the Definition box.

Remember to replace MyYear and MyMonth with the field names of your document.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

This should do the trick: monthend(makedate(MyYear, MyMonth)). Replace MyYear and MyMonth with your field names.


talk is cheap, supply exceeds demand
Not applicable
Author

Hallo Gysbert

Thank's for fast answer! How do I assign this to a variable?

Like this?

vMyLastdateofmonth = monthend (makedate (MyYear, MyMonth))

GunnarSchie

Gysbert_Wassenaar

If you want to create the variable in the script you can use

SET vMyLastdateofMonth = monthend(makedate(MyYear, MyMonth));

You can also create the variable in the Variable Overview window by clicking on the Add button and entering a name for the variable. After you've created the variable select it in the Variables list and then enter the expression in the Definition box.

Remember to replace MyYear and MyMonth with the field names of your document.


talk is cheap, supply exceeds demand