Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Qliksense_77
Creator
Creator

Load empty dates with the date of today

Hi,

I have data like below. If there is no disharce date yet, then the is "blank". 

I am searching for a method to fill the blank discharge dates with the date of today. I would like to do it in the load script and to have a new "discharge" date field similar to red field below.  

Can somebody help, please?

IdArrival dateDischarge dateNew "discharge date" field 
101-01-202104-01-202104-01-2021 
207-07-202110-07-202110-07-2021 
307-09-2021Blank08-09-2021Date of today
408-09-2021Blank08-09-2021Date of today

 

 

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try uing the alt - script and chart function to solve this.

LOAD   
   [Arrival date],
   [Discharge date],
   ALT([Discharge date], today()) as [New Discharge date]
FROM ....

View solution in original post

3 Replies
Digvijay_Singh

Something like this in the script - 

If(len([Discharge date]>0,[Discharge date],today()) as [New Discharge date]

 

Thanks,

Vegar
MVP
MVP

Try uing the alt - script and chart function to solve this.

LOAD   
   [Arrival date],
   [Discharge date],
   ALT([Discharge date], today()) as [New Discharge date]
FROM ....

Qliksense_77
Creator
Creator
Author

Thanks for helping @Vegar  and @Digvijay_Singh ,

I got the solution from Vegar to work.