Page 1 of 1

Number of months between two dates in Cognos TM1

Posted: Tue May 27, 2014 8:35 am
by Wirt
hi all,

I faced the problem of counting the number of months between two dates, for example:

there are two elements - the "start date" and "end date", it is string elements,

start date - 01.06.2014 (dd.mm.yyyy)

end date - 01.08.2016 (dd.mm.yyyy)

and yet there is an element of the "contract period", which is equal to the number of months from the start date to end date,
and I can not make the calculation algorithm
maybe someone have any ideas
thank you

Re: Number of months between two dates in Cognos TM1

Posted: Tue May 27, 2014 8:39 am
by Alan Kirk
Wirt wrote:
I faced the problem of counting the number of months between two dates, for example:

there are two elements - the "start date" and "end date", it is string elements,

start date - 01.06.2014 (dd.mm.yyyy)

end date - 01.08.2016 (dd.mm.yyyy)

and yet there is an element of the "contract period", which is equal to the number of months from the start date to end date,
and I can not make the calculation algorithm
maybe someone have any ideas
This tells you everything that you need to know about calculating with dates in TM1 including converting strings to dates. The bigger problem is... what is your definition of a "month"? Whole calendar months? Accounting months? Months based on average days? What about partial months? Until you decide on those issues you really can't do much.