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

Interval function with date field not working

Hi there,

I want the phase length (days) from the below table. I am using this in script -

IF(LEN([Phase_End_Date]) > 1,Interval( (date#((Phase_End_Date),'DD/MMM/YYYY')) - (date#(Phase_Start_Date,'DD/MMM/YYYY')), 'D'),0) as Phase_length

But getting NULL values. Please suggest

data.PNG

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @ashmitp869 

Based on ur screenshot, both Phase_End_Date & Phase_Start_Date are in date format already. So try like below

IF(LEN([Phase_End_Date]) > 1,Interval( Floor(Phase_End_Date) - Floor(Phase_Start_Date), 'D'),0) as Phase_length

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

View solution in original post

1 Reply
MayilVahanan

Hi @ashmitp869 

Based on ur screenshot, both Phase_End_Date & Phase_Start_Date are in date format already. So try like below

IF(LEN([Phase_End_Date]) > 1,Interval( Floor(Phase_End_Date) - Floor(Phase_Start_Date), 'D'),0) as Phase_length

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