Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

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

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

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