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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Difference between two months

I've got a table with the field OpenDate and i'd like to know how many months have passed between that date and today, can anyone suggest a formula?

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

i think you meant something like that:

...

num(month(now())) - num(month(OpenDate)) + (year(now()) - year(OpenDate))*12 as monthDiff

or absolut

fabs(num(month(now())) - num(month(OpenDate)) + (year(now()) - year(OpenDate))*12) as monthDiff

...

Best

Sacho

View solution in original post

2 Replies
Not applicable
Author

Hi,

i think you meant something like that:

...

num(month(now())) - num(month(OpenDate)) + (year(now()) - year(OpenDate))*12 as monthDiff

or absolut

fabs(num(month(now())) - num(month(OpenDate)) + (year(now()) - year(OpenDate))*12) as monthDiff

...

Best

Sacho

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

http://community.qlik.com/docs/DOC-3836

Regards,

Jagan.