Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Aldemarprins4
Contributor III
Contributor III

convert to date

Hello everyone,

I have the following field with May2022 and I want to convert it to 01/05/2022, is that possible in Qliview

Labels (4)
2 Solutions

Accepted Solutions
hic
Former Employee
Former Employee

... and if you want it formatted as a date, you need to wrap the above expression in Date():

=Date(Date#('May2022','MMMYYYY'))
or
=Date(Date#('May2022','MMMYYYY'),'DD/MM/YYYY')

View solution in original post

sicilianif
Creator II
Creator II

@Aldemarprins4  If you are going to have full month names, I think you would need to do this: 

=Date(Date#(Left('June2022',3)&right('June2022',4),'MMMYYYY'),'DD/MM/YYYY')

 

View solution in original post

7 Replies
Or
MVP
MVP

=Date#('May2022','MMMYYYY') should work here, I believe.

Aldemarprins4
Contributor III
Contributor III
Author

Hello, it doesn't work
What happens if the month changes? In other words, I am taking that month from the name of the file, but what happens when I go to June? If I leave that format, will it convert June to 05/01/2022?

hic
Former Employee
Former Employee

... and if you want it formatted as a date, you need to wrap the above expression in Date():

=Date(Date#('May2022','MMMYYYY'))
or
=Date(Date#('May2022','MMMYYYY'),'DD/MM/YYYY')

Or
MVP
MVP

What, exactly, doesn't work? "It doesn't work" doesn't give me any information about what the problem is.

You would replace the hardcoded string with your field. This was an example.

Aldemarprins4
Contributor III
Contributor III
Author

No still not working

sicilianif
Creator II
Creator II

@Aldemarprins4  If you are going to have full month names, I think you would need to do this: 

=Date(Date#(Left('June2022',3)&right('June2022',4),'MMMYYYY'),'DD/MM/YYYY')

 

Aldemarprins4
Contributor III
Contributor III
Author

thank you very much it works