Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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 (2)
1 Solution

Accepted Solutions
MayilVahanan
MVP
MVP

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
MVP
MVP

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.