Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to create yesterday date in DD/MM/YY format in script?

Hi,

Please help me out on 'To create yesterday date in DD/MM/YY format in script'

I used the below code

LET vMonthDate =Date(Num(Today()-1),'DD/MM/YYYY');

But its giving me the date in string format, I need that in date format to override the date in designer.

Thanks...

7 Replies
manideep78
Valued Contributor

Re: How to create yesterday date in DD/MM/YY format in script?

LET vLastDate = Date(Today()-1,'DD/MM/YYYY')

Re: How to create yesterday date in DD/MM/YY format in script?

Can you explain your problem little more?

Moreover below will helps

LET vMonthDate = Date(Num(Today()-1))

Not applicable

Re: How to create yesterday date in DD/MM/YY format in script?

It's giving me in the string format only, not in date format. So I could not change/override in the GUI fot that field.

manideep78
Valued Contributor

Re: How to create yesterday date in DD/MM/YY format in script?

It must get in Date format not in string format. If not please elaborate your problem little more in explanation.

MVP
MVP

Re: How to create yesterday date in DD/MM/YY format in script?

Hi,

This is working for me, when I reload the QVW file I am able to see Yesterday's date 31/03/13.

LET vMonthDate =Date(Today()-1,'DD/MM/YY');

Regards,

Jagan.

Not applicable

Re: How to create yesterday date in DD/MM/YY format in script?

I want to save the yesterday's date in qvd...

LET vMonthDate =Today()-1;

Temp:

LOAD  Date('$(vMonthDate)','DD/MM/YY') as Month_Date

FROM Data.xlsx (ooxml, embedded labels, table is Sheet1);

STORE Temp into Data.qvd(qvd);

Finally I achieved that by using the above code

Thankq...

MVP
MVP

Re: How to create yesterday date in DD/MM/YY format in script?

Hi,

I think this is most efficient one, no need of variable

Temp:

LOAD 

     Date(Today() - 1,'DD/MM/YY') as Month_Date

Autogenerate 1;

STORE Temp into Data.qvd(qvd);

DROP TABLE Temp;

Hope this helps you.

Regards,

jagan.

Community Browser