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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue Loading in TempCalendar

Dear QVExperts,

I am facing an issue.

LET varMinDate = '09/01/2008';

LET varMaxDate = '05/31/2013';

//DROP Table Temp;

    

TempCalendar:

LOAD

Date('$(varMinDate)' + IterNo() - 1) as TempDate

AutoGenerate 1

While '$(varMinDate)' + IterNo() -1 <= '$(varMaxDate)';

If execute this script, the dates should be loaded till 31st May 2013.

But it loads only till 28th May 2011.

It is surprising. Can you please suggest me.

Thanks

Sasi

12 Replies
Not applicable
Author

Even i try this,

LET varMinDate = '09/01/2008';

LET varMaxDate = '05/31/2013';

//DROP Table Temp;

    

TempCalendar:

LOAD

Date('$(varMinDate)' + IterNo() - 1) as TempDate

AutoGenerate 1

//While '$(varMinDate)' + IterNo() -1 <= '$(varMaxDate)';

While IterNo() <= '$(varMaxDate)' - '$(varMinDate)' +1;

But inserted till 28th May 2011.

Thanks,

Sasikumar

tamilarasu
Champion
Champion

Sasi,

Try this,

LET varMinDate = Num(Date#('09/01/2008','MM/DD/YYYY'));

LET varMaxDate = Num(Date#('05/31/2013','MM/DD/YYYY'));

TempCalendar:

LOAD

Date('$(varMinDate)' + IterNo() - 1) as TempDate

AutoGenerate 1

While '$(varMinDate)' + IterNo() -1 <= '$(varMaxDate)';

Kushal_Chawda

You need to use Date# to recognize the variable value as numerical

LET varMinDate = floor(date#('09/01/2008','MM/DD/YYYY'));

LET varMaxDate = floor(date#('05/31/2013','MM/DD/YYYY'));

//DROP Table Temp;

TempCalendar:

LOAD

Date('$(varMinDate)' + IterNo() - 1) as TempDate

AutoGenerate 1

While '$(varMinDate)' + IterNo() -1 <= '$(varMaxDate)';

Not applicable
Author

Hello Tamil,

THanks.

Still the same.

Please find enclosed the screenshot.

Not applicable
Author

Thanks Kush. Still the same. It loads till 28th May 2011.

Sasi

Kushal_Chawda

see may attached app

Anonymous
Not applicable
Author

Hi Sasi ,

Your script is working fine for me .

LET varMinDate = date#('01/09/2008','MM/DD/YYYY');

LET varMaxDate = Date#('05/31/2013','MM/DD/YYYY');

//DROP Table Temp;

   

TempCalendar:

LOAD

Date('$(varMinDate)' + IterNo() - 1) as TempDate

AutoGenerate 1

While '$(varMinDate)' + IterNo() -1 <= '$(varMaxDate)';

tamilarasu
Champion
Champion

Sasi,

It's working fine. Check the attachment.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Please post the Document Log so we may see what your script is doing.

-Rob