COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Sunita on 06 Jul 2010 12:21:46 PM

Title: Crosst tab calculation
Post by: Sunita on 06 Jul 2010 12:21:46 PM
Hi
I hav a cross tab report in which i have to display data in below format format
Column --   YYYYMM 
Row -- countryName1 - #Sends
                                 MTM Sends
Row -- countryName2 - #Sends
                                MTM Sends
---
MTM Sends is difference of month to month Sends i.e. (current month sends - previous month sends) for eg for July MTM will be (#sends in july - #Sends in june)

YYYYMM               | 201006      |201005   |201004
----------------------------------------------------------
US     | # Sends     |     5          |    2        |    5 
         | MTM Send  | 5-2= 3      |  2-5= -3  |   
Japan | # Sends     |     15        |    2         |    1 
         | MTM Send  | 15-2= 13   |  2-1= 1    |   

Can any one please help me with MTM calculation i.e. how can i calculate MTM value in cross tab report.

Thanks,
Sunita   
Title: Re: Crosst tab calculation
Post by: tupac_rd on 07 Jul 2010 09:12:36 AM
It is easy to get the MTM calculation using running-difference, but it will do it in the opposite direction. for eg. (#sends in june - #Sends in july) instead of (#sends in july - #Sends in june)
Title: Re: Crosst tab calculation
Post by: Sunita on 07 Jul 2010 10:21:42 AM
Thanks Tupac_rd :)

I guess it should work the way i want.... if i change the order in which i m showing month column

Thanks a lot  :)
Title: Re: Crosst tab calculation
Post by: mvjcognos on 13 Jul 2010 02:02:52 AM
Can u please elobarate ur question then i can give the excat answer..

1) 1 st tell me u have two date data item are there or from one data item u are calculating current and previous month and from that u want differnce of that two months..
2) For the differnce data item u want format as yyyymm it is easy for ex: to_char(sysdate,'YYYYMM') then it will give u exact format.....

from ur question what i have understood is u want from single date data item current month and previous month for that take data item name it as current month place the ur date dataitem in that and take one more datitem name it as previous month write a expression as _add_months(sysdate,-1) then u got  current month and previous month...

Now u want differnce between them take one more new dataitem and in that from functions check whether running-differnce or _days_between(current month,previous month)
try this once..........