Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
suryaa30
Creator II
Creator II

handling Null values in Date field

Hi All ,

I have an excel file with a date field. For other fields wherever there is blank I have used below expression so that I can select them from List box.

Make Blank values to Dummy variable:

IF(LEN(TRIM(FIELD))=0, 'UNSPECIFIED',FIELD) as FIELD

Now My question is how will apply something similar to above to a date field. I know one option would be to use a Dummy Date. Would it be possible I give the same Unspecified?

1 Solution

Accepted Solutions
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Surya,

You could do something like this:

if(not isNum(Date),'UNSPECIFIED',date(Date,'MMM-DD-YYYY')) as Date

for the sample data provided in the xlsx file, it gives me the following

Felipe.Sample.png

View solution in original post

4 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Surya,

You could do something like this:

if(not isNum(Date),'UNSPECIFIED',date(Date,'MMM-DD-YYYY')) as Date

for the sample data provided in the xlsx file, it gives me the following

Felipe.Sample.png

its_anandrjs

Yes you can try or else you can add any dummy date that recognise as dummy date

IF(LEN(TRIM(FIELD))=0, 'UNSPECIFIED',Date(FIELD)) as FIELD

suryaa30
Creator II
Creator II
Author

Thank you Felip

felipedl
Partner - Specialist III
Partner - Specialist III

Glad it helped Surya