Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calendar with first day of months

Hi all,

I have two date in two variables,

vMinDate = 01/01/2012

vMaxDate = 01/12/2014

and I want to generate a calendar with the first day of every months, like 01/02/2012, 01/03/2012, 01/04/2012 and so on.

I used the script

TempCalendar:

Load Distinct

monthstart($(vMinDate ) + rowno() -1) as TempDate

autogenerate $(vMaxDate ) - $(vMinDate ) +1;

there is a better way to do it?

Thanks.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Let vMinDate = NUM(Date('01/01/2012','DD/MM/YYYY'));

Let vMaxDate = NUM(Date('01/12/2012','DD/MM/YYYY'));

TempCalendar:

Load

  AddMonths($(vMinDate),IterNo()-1) as TempDate

AutoGenerate 1

While AddMonths($(vMinDate),IterNo()-1) <= $(vMaxDate);

View solution in original post

2 Replies
MK_QSL
MVP
MVP

Let vMinDate = NUM(Date('01/01/2012','DD/MM/YYYY'));

Let vMaxDate = NUM(Date('01/12/2012','DD/MM/YYYY'));

TempCalendar:

Load

  AddMonths($(vMinDate),IterNo()-1) as TempDate

AutoGenerate 1

While AddMonths($(vMinDate),IterNo()-1) <= $(vMaxDate);

Not applicable
Author

Thanks a lot!