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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Loading date fields from string values

I've got a question on formating while loading date fields from a source.

Mij date fields has the format "2016-04-07T17:41:01Z"

For this date to be imported as a date field I use 2 replace functions to get rid of the T and Z sign.

In the next step I use Date#( to convert it to a datefield and with Date( I format it.

This looks like this and works

Date(Date#(Replace(Replace(DATEFIELD,  'T',' '),'Z',''), 'YYYY-MM-DD hh:mm:ss'), 'DD-MM-YYYY')              as DATEFIELD

My question;  has anyone a sollution to make this statement simpler / more elegant.

Roland Raijmakers

Labels (1)
1 Reply
sunny_talwar
MVP
MVP

Have you tried this may be:

Date(Date#(Left(DATEFIELD, 10), 'YYYY-MM-DD'), 'DD-MM-YYYY') as DATEFIELD