Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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.

4 Replies
maxgro
MVP
MVP

= date(

date#('Apr 2 2011 12:00 AM', 'MMM DD YYYY hh:mm TT'), 'YYYYMMDD'

)

look at this for date and date# functions

QlikView Date fields

EDIT

see attachment

110652.png

vidyut
Partner - Creator II
Partner - Creator II

Makedate(Subfield(DateString,' ',3),Div(Index($(MonthNames),Subfield(DateString,' ',1)),4)+1,Subfield(DateString,' ',2)) as Date

Try this. $(MonthNames) refers to the variable MonthNames defined by default in your script.

Cheers,

Vidyut

Not applicable
Author

You are close,

Can you please help identify the error in this code

(Subfield([Fiscal Week Ending Date],' ',3),Div(Index($(MonthNames),Subfield([Fiscal Week Ending Date],' ',1),4)+1,Subfield([Fiscal Week Ending Date],' ',2))) as Date

[Fiscal Week Ending Date], is my date variable and seems like ')' is missing.

Not applicable
Author

I tried this. not working