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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
MVP
MVP

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

 

 

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
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
MVP
MVP

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

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.