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

Alt function question

Hi All,

I have a question I was hoping someone would be able to help me with. I am trying to write a command to fetch the date format from a column filled with dates: some are ddmmyyyy, some are mmddyyyy and so on and so forth. I was advised to use the ALT function, which now takes the following shape:

ALT( date#([Date], 'DD/MM/YYYY'), date#([Date], 'MM/DD/YYYY'), date#([Date], 'DD/MM/YYYY'), 'No Date Found') AS [Date Type]

But the function populates my 'Date Type' column with 'No Date Found' and doesn't recognise any of the dates in the 'Date' String. I tried running a trial command using ALT(date#([Date], ' correct date format specified in the initial set command'), 'No Date Found'), and the function still returns 'No Date Found'.

Any ideas on how to fix that?

11 Replies
MarcoWedel

please provide sample data/application

maniram23
Creator II
Creator II

Hi,

Try this one. it is help full for you.

date(alt(date#(DateString, 'YYYY-MM-DD'), date#(DateString, 'DD-MM-YYYY'), date#(DateString, 'DD/MM/YYYY'), 'NO DATA FOUND'),'DD/MM/YYYY') AS Date