Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
GeorgePhilips23
Partner - Contributor III
Partner - Contributor III

Text to Date (format change)

Hi, 

I have exported excel file where the date column is in text format 

for example: 

September 07, 2021
July 24, 2021
August 22, 2021
December 31, 2021
February 24, 2021

Now in Qlik Sense I have to transform it into a date format of 'DD-MM-YYYY'.

Can anyone give a best formula to achieve that?

Labels (1)
2 Solutions

Accepted Solutions
Digvijay_Singh

Something like this may be - 

Date(Date#(DateField,'MMMM DD, YYYY'),'DD-MM-YYYY')

View solution in original post

Zapparoli
Creator II
Creator II

George,

It seem that you are missing a space in your code, on the "YYYY" part.

try this:

Date(Date#(date_added,'MMMM DD, YYYY'),'DD-MM-YYYY') as OTT_Date

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

View solution in original post

9 Replies
Digvijay_Singh

Something like this may be - 

Date(Date#(DateField,'MMMM DD, YYYY'),'DD-MM-YYYY')

GeorgePhilips23
Partner - Contributor III
Partner - Contributor III
Author

4 M's didnt work

Digvijay_Singh

Worked for me - 

Digvijay_Singh_0-1662729625570.png

 

Digvijay_Singh

Digvijay_Singh_1-1662729781627.png

 

Digvijay_Singh

Check if you missed any space somewhere, not sure though

Zapparoli
Creator II
Creator II

The solution provided by @Digvijay_Singh works, I did some testing and in the script section in the SET variable you need to change the format of LongMonthNames by the name of your excel format:

Matheus_Zapparoli_2-1662730556736.png

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

Matheus_Zapparoli_1-1662730476343.png

This way it will work.

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

GeorgePhilips23
Partner - Contributor III
Partner - Contributor III
Author

Still didnt work!

Zapparoli
Creator II
Creator II

George,

It seem that you are missing a space in your code, on the "YYYY" part.

try this:

Date(Date#(date_added,'MMMM DD, YYYY'),'DD-MM-YYYY') as OTT_Date

Check my Youtube Channel for more Qlik Content
https://www.youtube.com/@ZappaAnalytics

GeorgePhilips23
Partner - Contributor III
Partner - Contributor III
Author

Yes, worked. Thanks a lot.