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

How to Change NULL in the current date?

Hello,

I'm using an oracle database (Im using Qlikview personal edition). Im loading columns filled with a date, what i want is to load the current date where the cel is NULL.

Here is a part of the database:

DATE1DATE2DATEE3
17-12-2012 0:0020-12-2012 0:0020-12-2012 0:00
19-12-2012 0:0019-12-2012 0:0019-12-2012 0:00
20-12-2012 0:0031-12-4000 0:00
24-12-2012 0:0031-12-4000 0:00
27-12-2012 0:0031-12-4000 0:00
27-12-2012 0:0030-12-2012 0:0030-12-2012 0:00
27-12-2012 0:0031-12-4000 0:00
31-12-2012 0:0031-12-4000 0:00

Im using a chart with the following expression SUM(DATE3 - DATE1 +1). Does somebody now how i can load the NULL's as the current date, so that it will load today as 03-01-2013 and tomorrow as 04-12-2013 (when i refresh my script) etc.?

4 Replies
MayilVahanan

Hi

Try like this

Load *,if(len(trim(Datefield))=0,Today(),DateField) as Datefieldname;

Select * from tablename;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Thanks for your quick response but my expression, which was SUM(DATE3 - DATE1 +1) and now must be SUM(Datefieldname - DATE1 +1) won't work anymore. The connection (if that's the right way to call it) between the colums is lost then.

EDIT: Hmm, it appears i did something wrong, let me try it again.

khadeer
Specialist
Specialist

In Backend try this one,

if(DATE3=null(),date(Today()),DATE3) as DATE3

Hope it will helps u.

Not applicable
Author

Try This,

if(IsNull(Date3)or Date3 ='',Date(Today()),Date3) as date3

Hope it helps