Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_2583
Contributor III
Contributor III

Date Difference using end date and todays date

Hi, 

I am looking to create a new calculated field to work out the number of months between 2 dates and I have this logic which seems to work fine (but happy to accept a better or more accurate way if there is one):

ROUND(([End_Date] - [Start_Date] )/30)

However, the above logic isn't totally accurate as some jobs don't yet have an end date. Any idea how I can use the existing logic, but also take into consideration the difference in months from Start_Date to today's date please?  

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

hope i understand your issue correctly. issue is when end date is empty you want to use todays date?

if so

ROUND(( if(isnull([End_Date]),today(),[End_Date]) - [Start_Date] )/30)

or instead of isnull above len([End_Date])=0

View solution in original post

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

hope i understand your issue correctly. issue is when end date is empty you want to use todays date?

if so

ROUND(( if(isnull([End_Date]),today(),[End_Date]) - [Start_Date] )/30)

or instead of isnull above len([End_Date])=0