Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Partner
Partner

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
MVP
MVP

Re: Min Date for creating master Calendar

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

4 Replies
MVP
MVP

Re: Min Date for creating master Calendar

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

Partner
Partner

Re: Min Date for creating master Calendar

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
Partner
Partner

Re: Min Date for creating master Calendar

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
Partner
Partner

Re: Min Date for creating master Calendar

Thank you all for your immediate response and suggestions.