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

Converting formats

Hi all,

I am a qlikview learner , i have a requirement in which my data consists of different date formats eg('DD-MM-YYYY/DD-MMM-YYYY etc )

Now i am trying to convert all the above date formats in to one format Like 'MM-DD-YYYY') .Any Ideas please

Thanks In advance

Labels (1)
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

If you have more than one DateField, you need to use Alt, Date# and Date functions to convert to single format... Check below example where DateField is Converted to your requested Format..

I have kept DateField and NewDateField both for your comparison purpose.. You can obviously remove DateField and Rename the Formula as DateField...

Load

  DateField,

  Date(ALT(Date#(DateField,'DD-MM-YYYY'),Date#(DateField,'DD-MMM-YYYY')),'MM-DD-YYYY') as NewDateField

Inline

[

  DateField

  01-01-2014

  20-09-2014

  10-MAR-2014

  15-SEP-2014

];

View solution in original post

3 Replies
antoniotiman
Master III
Master III

Hi,

use Date# function.

E.g.

if your format is DD-MM-YYY

Date(Date#(fielddate,'DD-MM-YYY'),'MM-DD-YYY')

Regards

MK_QSL
MVP
MVP

If you have more than one DateField, you need to use Alt, Date# and Date functions to convert to single format... Check below example where DateField is Converted to your requested Format..

I have kept DateField and NewDateField both for your comparison purpose.. You can obviously remove DateField and Rename the Formula as DateField...

Load

  DateField,

  Date(ALT(Date#(DateField,'DD-MM-YYYY'),Date#(DateField,'DD-MMM-YYYY')),'MM-DD-YYYY') as NewDateField

Inline

[

  DateField

  01-01-2014

  20-09-2014

  10-MAR-2014

  15-SEP-2014

];

Anonymous
Not applicable
Author

Thanks Manish Kachhia !!!

Its Working for me