Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Format


Hi,

I have a date format as "Apr 2 2011 12:00 AM", how can I convert this into "YYYYMMDD"? The time is always12:00 AM.

Thanks.

14 Replies
maxgro
MVP
MVP

see attachment

date.png

its_anandrjs

Hi,

Write some thing like

load *,

      date(  date#([Fiscal Week Ending Date], 'MMM DD YYYY hh:mmTT'), 'YYYYMMDD h:mm:ss TT'  );

LOAD [Fiscal Week Ending Date],

     FormattedDate

FROM your location

Thanks & Regards

Not applicable
Author

This works for two digit 'DD". If you scroll down your QVW , you will see result has not populated for one digit day.

maxgro
MVP
MVP

if you have different format, use the alt function

date(

  alt(

  date#([Fiscal Week Ending Date], 'MMM DD YYYY hh:mmTT'),

  date#([Fiscal Week Ending Date], 'MMM  D YYYY hh:mmTT')

  )

, 'YYYYMMDD'  )

Not applicable
Author

Awesome