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

Min Date for creating master Calendar

Hi Experts,

I have to create master calendar with default dates because I don't have the date field.

My Min date will be = 01/03/2018  (DD/MM/YYYY)

and

My max date will be = Today()-1

Please guide how can I achieve this.

Thanks in advance.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Let vMinDate=Num(MakeDate(2018,3,1));
Let vMaxDate= Num(Today()-1);

Load
Date($(vMinDate)+RowNo()-1) as Date,
Month($(vMinDate)+RowNo()-1) as Month,
Year($(vMinDate)+RowNo()-1) as Year
AutoGenerate $(vMaxDate)-$(vMinDate)+1;

 

Edit: corrected the min date

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

Let vMinDate=Num(MakeDate(2018,3,1));
Let vMaxDate= Num(Today()-1);

Load
Date($(vMinDate)+RowNo()-1) as Date,
Month($(vMinDate)+RowNo()-1) as Month,
Year($(vMinDate)+RowNo()-1) as Year
AutoGenerate $(vMaxDate)-$(vMinDate)+1;

 

Edit: corrected the min date

JordyWegman
Partner - Master
Partner - Master

Hi Deepaksingh,

Use the following.  @MK_QSL  had solved this before. I've edited a bit for you.

MinMaxDate:
Load
Floor(Date('08/12/2005','DD/MM/YYYY')) as MinDate,
Floor(Today()-1) as MaxDate
AutoGenerate 1;
Let vMinDate = NUM(PEEK('MinDate',0,'MinMaxDate'));
Let vMaxDate = NUM(PEEK('MaxDate',0,'MinMaxDate'));
Calendar:
Load
Date(DateNum) as Date,
  Month(DateNum) as Month,
  Year(DateNum) as Year;
Year(DateNum) as Year;
Load
  $(vMinDate) + IterNo() - 1 as DateNum
AutoGenerate 1
While $(vMinDate) + IterNo() - 1 <= $(vMaxDate);

Jordy

Climber

Work smarter, not harder
formosasol
Partner - Contributor III
Partner - Contributor III

Hi
You can use this formula =makedate(2019,01,01) for Min date.
You can use this formula =date(today()-1,"DD/MM/YYYY") for Max Date

Regards
Frank
DS14
Partner - Contributor III
Partner - Contributor III
Author

Thank you all for your immediate response and suggestions.