COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: anirudh on 11 Jun 2014 03:08:58 PM

Title: YTD Calculation
Post by: anirudh on 11 Jun 2014 03:08:58 PM
Hello Cognos Gurus!

I have an Amount column in my report that displays the amount for an executive based on the Month and Year input parameter value. So I have two input parameters ?P_Month? and ?P_Year?. I need another column that calculates this amount on a Year to Date basis. This Year to Date calculation should not be on the current sysdate. It should be based on the input parameter value i.e, if I run the report for March 2014, the YTD column should be calculated only until March 2014 and not the sysdate.

So this is how the report is supposed to look like.

Exec                Amt for June2014                   Amt (YTD)
A                               232                                 3343
B                               987                                 5466
C                               124                                 1246

Thanks a lot for the help in advance!
Title: Re: YTD Calculation
Post by: Satheesh on 12 Jun 2014 02:00:05 AM
Hi,


So you have already one query having Year month filters right.


Just Copy paste the same Query make the name as YTD Query


As you know every month is starting from one only....


in YTD query make the Month filter like below


[month] between 1 and ?P_Month?


year filter is same as your query..


now join the two queries on Executive data item.




Thanks & Regards
Sateesh Chapparapu
Mumbai
Title: Re: YTD Calculation
Post by: anirudh on 12 Jun 2014 07:40:09 AM
Thanks a lot Sateesh! Worked like a charm!