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: 
Not applicable

Display a duration in months

Hello,

I looked at function "interval" and its formats.

I'd like to display a duration "in months" between 2 dates ?

I don't know why but the expression I wrote doesn't give the right answer ...

Here it is :

>>>> '&interval((Now() - Min(TKT_CHANGE_DATE)), 'MM hh:mm')

or

>>>> '&interval((Now() - Min(TKT_CHANGE_DATE)), 'MM')

the hours hh:mm are ok, but the values in days are > 30, and values in MM it still 0 ... in both cases !

What is wrong ?

Thanks a lot for your help,

Olivier

1 Reply
Anonymous
Not applicable
Author

Oliver,
MM format doesn't work with interval function. It accepts only days (DD), hours(hh), minutes(mm), and seconds(ss). I assume it is so because month is not a constant time span.
You can use intrval in days divided by 30, or use a more complex logic if really necessary.