Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Numeric Date Value

Good Morning Qliker's

I have a simple question.  I have a date value 03/18/2020 that I need to make just this date numeric...any help.

Thanks

Labels (1)
1 Solution

Accepted Solutions
tmumaw
Specialist II
Specialist II
Author

Here is what I have in my script.  I need to make vStartDate numeric.

LET vStartDate = '03/18/2020';

Num(Date('$(vStartDate)', 'MM/DD/YYYY')) AS vNumWkend;

 

Thanks

View solution in original post

4 Replies
QFabian
Specialist III
Specialist III

Hi @tmumaw , a date in qlik is saved as a number, and if it is a timestamps, date and hour, the date is the number  and the hour is the decimal part.

So if you just use num(DateField), you can see that Date as a number.

You can "format" too :

 

 

QFabian_4-1611233175157.png

 

 

QFabian_3-1611233149042.png

 

 

 

QFabian
tmumaw
Specialist II
Specialist II
Author

Here is what I have in my script.  I need to make vStartDate numeric.

LET vStartDate = '03/18/2020';

Num(Date('$(vStartDate)', 'MM/DD/YYYY')) AS vNumWkend;

 

Thanks

tmumaw
Specialist II
Specialist II
Author

Got it to work.  Thanks for your help.  Here is what I did.

Let vNumStartDate = Num(Date('$(vStartDate)', 'MM/DD/YYYY'));

QFabian
Specialist III
Specialist III

Excelent! @tmumaw , but you dont need to use the date function.

Just check if your initials system variables sday that your date separator is '/' or '-'

QFabian