

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to calculate difference between two dates in months - rounding to 1 decimal place
I am trying to calculate the difference in months between two dates but needing to round to one decimal place. I found the below on the forum, but do not understand the format. It is returning the number rounded.
Needing the difference between today and EFFECTIVE_DATE rounded to 1 decimal place.
year(today(2))*12)+month(today(2))) - (((year(EFFECTIVE_DATE)*12)+month(EFFECTIVE_DATE)))
Thank you!
- Tags:
- new_to_qlikview

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check this link out by jagan: Calculating Months difference between two dates


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was hoping for an explanation of the formula I sent. Thanks anyway.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since your formula just calculates difference between two integers (using sequential month numbers started in Jan 0000 for two dates), you can't calculate something with significant decimal places from that.
Here is a thread that covers some alternatives and also tries to explain the difficulty in defining a 'month' distance between dates:
How Do I Get the Number of Months Between Two Dates?
edit:
And if you want a more accurate calculation of date difference in Year,Month, Days, maybe use something like
