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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Date transformation


Hey All

if i have a filed Date look like this for example '20150831' how can tranform this into a number ?

Thank you, hope you can help.

8 Replies
sunny_talwar

Try this:

Num(Date#('20150831', 'YYYYMMDD'))

For a whole field to be converted, try this:

Num(Date#(DateField, 'YYYYMMDD'))

qlikmsg4u
Specialist
Specialist

For Number Format : Num(Date#('20150831', 'YYYYMMDD'))

For Date Format : Date(Date#('20150831', 'YYYYMMDD'),'MM/DD/YYYY')

Not applicable

Hey Sunny,

I just tried this in a text box and am not getting any result.

I used the expression:

=Num(Date#(today(), 'YYYYMMDD'))

and the output am getting is: - (hyphen)

kamalqlik
Partner - Specialist
Partner - Specialist

Hi Gergy,

Please find the attached application for your refrence

REgards

Kamal

hic
Former Employee
Former Employee

Date(Date#(DateField, 'YYYYMMDD'),'YYYY-MM-DD')

See QlikView Date fields

HIC

MarcoWedel

H‌i,

20150831 already is a number, isn't it?

Please specify if it's not quite the number you are looking for.

thanks

regards

Marco

sunny_talwar

Since your date format must be set differently, your Today() won't be in YYYYMMDD format. When you use Date# and specify that Today is in YYYYMMDD you get null(). But mario Gergy-sarkis‌ specified that his date is in YYYYMMDD format, so I am telling QlikView to understand his date format by using the Date#() function.

In short, you can just do this and it will work:

=Num(Today())

qlikviewwizard
Master II
Master II

Hi,

What you are going to do after converting the number again to number?

Do want to use in where clause?