Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor

Issue in generating dates

Hi,

I have written a simple script wherein I am generating dates.

LOAD Date;
LOAD Date(($(vStartDate) + RecNo()),'MM/DD/YYYY') as Date
AutoGenerate vEndDate - vStartDate;

After running the script, the Date field contains values from 12/31/1899 to 12/29/1900.

However, I wish to generate all the dates between 1/1/2017 to 12/31/2017. Can someone please help me as to where I am going wrong.

Thanks,

Asma

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Issue in generating dates

Hi convert them to number.

Let vStartDate = num(makedate(2017,1,1,));

Let vEndDate = num(makedate(2017,12,31));

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

6 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Issue in generating dates

Hi,

Make sure that the vStartDate variable has got the correct date in number format.

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Highlighted
Contributor II

Re: Issue in generating dates

Hey, could you show what vStartdate contains?

May be it is problem with the format of your variable

Highlighted
Contributor

Re: Issue in generating dates

I have created start date and end date variables s:

LET vStartDate = MakeDate(2017,1,1);
LET vEndDate = MakeDate(2017,12,31);

Highlighted
MVP & Luminary
MVP & Luminary

Re: Issue in generating dates

Hi convert them to number.

Let vStartDate = num(makedate(2017,1,1,));

Let vEndDate = num(makedate(2017,12,31));

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".

View solution in original post

Highlighted
Contributor

Re: Issue in generating dates

Thanks Kaushik for the solution!

Highlighted
Contributor

Re: Issue in generating dates

Can someone please as to why the below code returns only value 01/01/2017 in Date field.

LOAD Date,
Month(Date) as Month,
Year(Date) as Year;
LOAD Date($(vStartDate) + RowNo(),'DD/MM/YYYY') as Date
AutoGenerate vEndDate - vStartDate;