Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

robert99
Valued Contributor II

convert eg 21. January 2015 to a date

The date is in this format

DD. MMMM YYYY

I converted using  (@5  is the date field)

subfield (@5 ,'.' , 1)   & '/'   &   NUM (MONTH (DATE#( PURGECHAR( @5, '. 1234567890'), 'MMM'))) & '/' & 2016 as DateInv

NB Its only 2016 dates for now

Why doesn't something like this work

Date# (@5 , 'DD. MMMM YYYY')

I tried everything I could think of but no joy

Including converting @5 to 21January2016 (using trim and purgechar etc) before using date#

Thanks for any help.

1 Solution

Accepted Solutions

Re: convert eg 21. January 2015 to a date

Use below in script

Date(Date#(YourDateField,'DD. MMMM YYYY'), 'DDMMMMYYYY') as YourDateField

or

below in front end

Date(Date#(YourDateField,'DD. MMMM YYYY'), 'DDMMMMYYYY')

3 Replies

Re: convert eg 21. January 2015 to a date

Use below in script

Date(Date#(YourDateField,'DD. MMMM YYYY'), 'DDMMMMYYYY') as YourDateField

or

below in front end

Date(Date#(YourDateField,'DD. MMMM YYYY'), 'DDMMMMYYYY')

Re: convert eg 21. January 2015 to a date

or use this

Date(Date#(subfield (@5 ,'.' , 1) & '/' & PURGECHAR( @5, '. 1234567890') & '/' & SubField(@5,' ',-1),'DD/MMMM/YYYY'),'DD/MMM/YYYY') as DateInv

robert99
Valued Contributor II

Re: convert eg 21. January 2015 to a date

Thanks Manish

Very simple. Strange I'm sure I tried this but it didn't work.