If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
I have a date field where dec 2020 is in this format: 2020M12 and so on.
The same date field also contains one date in this format DD/MM/YYYY which is the newest date in the data.
I want to convert all dates to this format DD/MM/YYYY.
How to do this?
The reason for this, is that I need to show what is status now compared to same month last year. And I know how to do this, if all dates are in the standard date format.
If I suppose 2020M12 wil be 01/12/2020 you can use :
Date(Alt(Num(makedate(subfield(DateField,'M',1),subfield(DateField,'M',2),01)), Num(Date#(DateField, 'DD/MM/YYYY'))), 'DD/MM/YYYY') as NewDateField
like this :
load *,Date(Alt(Num(makedate(subfield(DateField,'M',1),subfield(DateField,'M',2),01)), Num(Date#(DateField, 'DD/MM/YYYY'))), 'DD/MM/YYYY') as NewDateField inline [
if 2020M12 for example not 01/12 but 31/12 or other date you can change 1 by your number
View solution in original post
Thank you for fast reply.
Now I have this problem:
this problem is not related to date format problems,but seems to be in the modeling or the calculation of measure
You are right. Your solution work. Thanks a lot😀