Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue in comparing date format

Hi All,

I have used the below expression for comparing the date format of a field.

isnum(date(date#(datefield,'MM-DD-YYYY'))).

When I load the datefield, then eventhough the values present in the field are in the format MM-DD-YYYY, but still it is returning 0.

I have to basically compare some field values against dofferent date formats and assign the values as described below:

1.If datefield has values in DD-MM-YYYY, then the field Date value should contain DD-MM-YYYY

2. If datefield has values in MM-DD-YYYY, then the field Date value should contain MM-DD-YYYY

3. If datefield has values in MM-DD-YYYY hh:mm:ss TT, then the field Date value should contain MM-DD-YYYY hh:mm:ss TT

4. 3. If datefield has values in hh:mm:ss, then the field Date value should contain hh:mm:ss

Can someone help in this?

Thanks,

Asma

3 Replies
arulsettu
Master III
Master III

post your sample file

swuehl
MVP
MVP

Look into the alt() function, this should make it easy to parse different date and time formats in.

Coming to your issue with a date field not being parsed correctly, could you post at least some samples of your date field?

madhumitha
Creator
Creator

Hello Azma,

Please try this

isnum(date#(text(datefield),'MM-DD-YYYY'))