Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
March 26 at 10am ET: See how Qlik drives growth and value in ISV segment - REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date and Time into Date

Hi,

I have a problem with a time column in the excel sheet that I'm trying to import to QV. I would like to convert the following:

Svarstid
11.06.2013 15:33:00:117
11.06.2013 15:43:11:320
12.06.2013 10:50:27:877
12.06.2013 17:29:30:343

to this format:

YYYY-MM-DD

What do I need to do?

Thanks,

Petra

4 Replies
Not applicable
Author

SET DateFormat='YYYY-MM-DD';

Load date(date#(Svarstid,'DD.MM.YYYY hh:mm:ss[:fff]')) as New_Svarstid, Svarstid as NewDate Inline [

Svarstid

'11.06.2013 15:33:00:117'

'11.06.2013 15:43:11:320'

'12.06.2013 10:50:27:877'

'12.06.2013 17:29:30:343'

];

shree909
Partner - Specialist II
Partner - Specialist II

Hi try this in the script

Load

Svarstid,

Date(Date#(SubField(Svarstid,' ',-2),'DD.MM.YYYY'),'YYYY-MM-DD') As NewDate

from ......

rustyfishbones
Master II
Master II

Try this, it's the same as above, but I had made sure it worked so I thought I would add it anyway

QC87059.png

you could also try

QC870592.png

nagaiank
Specialist III
Specialist III

Or try the following:

Load date(Floor(date#(Svarstid,'DD.MM.YYYY hh:mm:ss[:fff]')),'YYYY-MM-DD') as New_Svarstid, Svarstid as NewDate Inline [

Svarstid

'11.06.2013 15:33:00:117'

'11.06.2013 15:43:11:320'

'12.06.2013 10:50:27:877'

'12.06.2013 17:29:30:343'

];