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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Change date format

Hello -

I have a field name '[Transaction Date' that is in a format of 'Jan 30, 2015, 12:00 AM.

In my script, using a date map, I changed the format to show as 1/30/2015 using the following script :

MakeDate(Mid([Transaction Date], 8,5), ApplyMap('MonthMap',Left([Transaction Date], 3)),Replace(Mid([Transaction Date],4,3), ',','')) AS Source,

However, I want the format to actually read as 'YYYY/MM/DD'

How can I alter my script to reflect this format.

Thank you.

1 Solution

Accepted Solutions
Anonymous
Not applicable

See attached - it works. Maybe you missed something in problem description - could you please upload your file?

View solution in original post

6 Replies
buzzy996
Master II
Master II

can u try,

Makedate(Year([DATEfield]),Month([ DATEfield]),Day([ DATEfield])) as DayMonthYear,

Anonymous
Not applicable

I think this should work:

date(date#("Transaction Date", 'MMM D, YYYY, hh:mm TT'),'YYYY/MM/DD')

Except, I'm not sure D or DD.  If single digit days are like 9 - use D, if 09 - use DD.

evansabres
Specialist
Specialist
Author

Thank you. Would I add that on the same line of code as my MakeDate or on a separate line?

Anonymous
Not applicable

That's the whole line, no need for makedate():

date(date#("Transaction Date", 'MMM D, YYYY, hh:mm TT'),'YYYY/MM/DD') as Source

evansabres
Specialist
Specialist
Author

when I enter that as the line of code, it returns a value of -

Anonymous
Not applicable

See attached - it works. Maybe you missed something in problem description - could you please upload your file?