Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ankur13agrawal
Contributor III
Contributor III

Convert string Aug,31 2020 into date 31/09/2020

I have a column with filed name as Start_date which is varchar type and date is in format Aug,31 2020 and i want to convert it into Date format 31/09/2020.

Currently when i am trying month(start_date) i am getting no result as qlik is not able to identify column as a date..so its not able to give me the expected output

 

Help is appreciated

1 Solution

Accepted Solutions
Anil_Babu_Samineni

You should place correct format in the first step otherwise we need to spend lot of time to know, Anyway this should work since your format is MMM DD, YYYY but not MMM, DD YYYY

Date(Date#("START_DATE", 'MMM DD, YYYY')) as ankur,

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

9 Replies
Anil_Babu_Samineni

Perhaps this

=Date(Date#('Aug,31 2020', 'MMM,DD YYYY'))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ankur13agrawal
Contributor III
Contributor III
Author

Thanks
This is working for a particular date...i have multiple date under start_date column.i need all the value to get converted

Anil_Babu_Samineni

You can still do

=Date(Date#(FieldName, 'MMM,DD YYYY'))

If you have multiple dates in different format you should write like this

Date(Alt(Date#(FieldName, 'MMM,DD YYYY'), Date#(FieldName, 'MMM DD YYYY'), Date#(FieldName, 'MMM -DD YYYY'), Date#(FieldName, 'MM/DD/YYYY'), ...))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ankur13agrawal
Contributor III
Contributor III
Author

Date(Date#("START_DATE", 'MMM,DD YYYY')) as ankur,
Tried this but ankur is coming as -

 

I have only one format but many values

Aug,31 2020

May,20,2019

ankur13agrawal
Contributor III
Contributor III
Author

Correction

May,20 2019

Anil_Babu_Samineni

Image or file please to check?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ankur13agrawal
Contributor III
Contributor III
Author

ankur13agrawal_0-1609161228787.png

 

ankur13agrawal_1-1609161255562.png

ankur13agrawal_2-1609161286053.png

 

Note-Start_date field is set as varchar from the source

Anil_Babu_Samineni

You should place correct format in the first step otherwise we need to spend lot of time to know, Anyway this should work since your format is MMM DD, YYYY but not MMM, DD YYYY

Date(Date#("START_DATE", 'MMM DD, YYYY')) as ankur,

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ankur13agrawal
Contributor III
Contributor III
Author

thanks a lot!!
for correcting my mistake..it worked