Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
gokulnath2592
New Contributor III

String date to num date

Hi all,

In my data, date is in string format.I want to converted it in to number format.

I used below query for the conversion.

date(date#([AssignEndDt  ],'MM/DD/YYYY'),'MM/DD/YYYY') as end_date

but it was not working.

9 Replies

Re: String date to num date

Hi,

You need to take care of format masking.

Can you upload few sample data to look over.

Regards

ASHFAQ

gokulnath2592
New Contributor III

Re: String date to num date

qlik.PNG
Hi ashfaq,

I attached my data above.

Re: String date to num date

Try like this

date(date#([ProjEndDt],'M/DD/YYYY HH:MM TT'),'MM/DD/YYYY')

or

=date(date#('1/31/2016 12:30 AM','M/D/YYYY hh:mm tt'), 'MM/DD/YYYY')

Regards

ASHFAQ

MVP
MVP

Re: String date to num date

Hi


date(date#([AssignEndDt  ],'M/D/YYYY hh:mm tt'), 'MM/DD/YYYY') as end_date


HTH

Jonathan



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
gokulnath2592
New Contributor III

Re: String date to num date

Ashfaq,

I tried your query, Again same will be displayed

gokulnath2592
New Contributor III

Re: String date to num date

jonathan,

I tried your query its working now.

Thanks,

Gokul

Re: String date to num date

Try like this

=date(date#('1/31/2016 12:30 AM','M/D/YYYY hh:mm tt'), 'MM/DD/YYYY')

Can you upload your app

Regards

ASHFAQ

gokulnath2592
New Contributor III

Re: String date to num date

Ashfaq,

sorry, I cant upload app.

thanks for your help, date format is changed.

Thanks,

gokul

gokulnath2592
New Contributor III

Re: String date to num date

thank you guys for your help

Regards,

gokul

Community Browser