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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Specialist
Partner - Specialist

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

CELAMBARASAN
Partner - Champion
Partner - Champion

Can you explain your problem little more?

Moreover below will helps

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

Not applicable
Author

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

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

jagan
Partner - Champion III
Partner - Champion III

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
Author

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

jagan
Partner - Champion III
Partner - Champion III

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.