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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
aritting
Creator
Creator

I need a Date Time Function to create a Integer Date in format YYYYMMDD?

I want to convert the current date to an integer value in the format YYYYMMDD.

For example, Today is 12/09/2016 in MM/DD/YYYY format and converted to YYYYMMDD is 20161209.

I would be using the today() or now() function as the source of the date.

Can any provide an example in how to do this in Qlik script?

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be like this:

This is still date, but in the required format

LOAD Date(Today(), 'YYYYMMDD') as Date

or

This is a number now

Num#(Date(Today(), 'YYYYMMDD'), '##') as DateNumber

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

May be like this:

This is still date, but in the required format

LOAD Date(Today(), 'YYYYMMDD') as Date

or

This is a number now

Num#(Date(Today(), 'YYYYMMDD'), '##') as DateNumber

aritting
Creator
Creator
Author

yes, that works in a Load statement and expression

Num#(Date(Today(), 'YYYYMMDD'), '##') as DateNumber

or

LET vL.MyVar = Num#(Date(Today(), 'YYYYMMDD'), '##');

aritting
Creator
Creator
Author

Thank you very much!