Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Date conversion to Number

I need to convert a date field into Numeric.

Num(Date ( 2014/11/12 , 'YYYYMMDD' )  )

output expecting:20141112

The num function giving me the result but not the way I was expecting.Any help on this would be great.

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

If you really want the *numeric* value to be 20141112, then I think it would be done like this:

=num#(Date(Date#('2014/11/12','YYYY/MM/DD') ,'YYYYMMDD'),'0')

-Rob

View solution in original post

10 Replies
Highlighted

Try something like this

Num(Date# ( '2014/11/12' , 'YYYY/MM/DD' )  )

Highlighted

Or maybe even this :

date ( (Date# ( '2014/11/12' , 'YYYY/MM/DD' ), 'YYYYMMDD' ) 

Highlighted
Specialist II
Specialist II

Hi,

see this:

Num(Date#(Field, 'MM/DD/YYYY')) AS NumericDate

Regards

André Gomes

Highlighted

Try in place of the NUM with Date#

=Date (Date#('2014/11/12' , 'YYYY/MM/DD' ) ,'YYYYMMDD')

Regards

Anand

Highlighted
Partner
Partner

Try this

=Date ( Floor(Date# ( '2014/11/12' , 'YYYY/MM/DD' )), 'YYYYMMDD' )

Highlighted

Or you can try

=Date(Num(Date# ( '2014/11/12' , 'YYYY/MM/DD' ) ),'YYYYMMDD')

Regards

Anand

Highlighted

Hi,

This should work

=Date(Date#('2014/11/12','YYYY/MM/DD') ,'YYYYMMDD')


Regards

ASHFAQ

Highlighted
MVP & Luminary
MVP & Luminary

If you really want the *numeric* value to be 20141112, then I think it would be done like this:

=num#(Date(Date#('2014/11/12','YYYY/MM/DD') ,'YYYYMMDD'),'0')

-Rob

View solution in original post

Highlighted
Not applicable

Thanks Rob.It is always a pleasure to see you here.Yes I wanted to have a numeric value because at the end I am going to comapre this date converted numeric vaule with another Numeric field.Thanks again for your help.