Different date formats from different source files
Dear Qlik Community,
I am a bit confused regarding the alt function. I have the following two text files:
Dates1.txt contains Dates with the format DD/MM/YYYY:
Dates2.txt contains dates with the format MM/DD/YYYY:
When using the alt function, it seems that QlikView is not able to interpret the different date formats correctly. The list box with the field "Date" shows:
The last entry should be 12.01.15. What am I missing?
I know, I can format the Dates separately in the code when loading the text files. But is there a way to use the alt function when loading the "DATA_WITH_ALT" table (see attachment) and get the right results?
Re: Different date formats from different source files
the problem in your case is that the formats DD/MM/YYYY and MM/DD/YYYY are ambiguous in cases where day of month and month numbers both are <= 12. You can't tell then if 01/12/2015 is Dec 1st or Jan 12th.
If the formats would be unambiguous for all possible values, like when using distinct separators, you could use ALT() function, for example