COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bvk.cognoise on 21 May 2012 12:04:37 AM

Title: Summary for every four weeks?
Post by: bvk.cognoise on 21 May 2012 12:04:37 AM
Hi Mates,

I need some help to Fullfill this requiremnt.

i am creasting a crosstab report
for eg:country in rows,
           Weeks in columns
           revenue as measure     


               w1 w2 w3 w4 w5 w6 w7 w8 w9 w10
Country    1    3    4   2    3  6     2   4    4     4


now i  need a column in rows place which gives sum of every 4 weeks (its should only sum up 4 weeks)for eg:

               w1 w2 w3 w4 w5 w6 w7 w8 w9 w10
Country    1    3    4   2    3  6     2   4    4     4
summ:       0   0    0   10 12 15  13  15   16  14

please help me to fix this.

i am using cube as source.


Thanks
Bvk
Title: Re: Summary for every four weeks?
Post by: Gyana on 21 May 2012 04:41:35 AM
use in Summary :
moving-total (revenue ,4)
Title: Re: Summary for every four weeks?
Post by: bvk.cognoise on 22 May 2012 02:45:44 AM
Hi Sekhar,

Thank you very much for your reply.but i am not getting correct result if i use above expression  :(.if i am correct moving-total function works only for relational modellling.but i am using Cube as source so could please clarify on the same.
Can any body suggest any othereway please.

Thanks
bvk

Title: Re: Summary for every four weeks?
Post by: pricter on 23 May 2012 07:54:24 AM
I am not sure for what r you looking.

Could you look at the attached picture if what I make is what are you looking for.
Title: Re: Summary for every four weeks?
Post by: bvk.cognoise on 29 May 2012 03:00:58 AM
Hi pricter,

If your using Cube or DMR data as source ...yes i am looking for the same solution,can you please explian the same how you did it?

Thanks
Bvk
Title: Re: Summary for every four weeks?
Post by: pricter on 29 May 2012 03:52:49 AM
Hi bvk,
base on the Sales on marketing cube (cognos sample cube) I have used the following data items
Months,
Quantity,
Data Item 1 : expression : moving-total ([Quantity] ,4)
run-total : expression : running-total (1)
Four Month : expression : if ( mod (run-total,4)=0) then ([Data Item1]) else (0)
and then place them on the crosstab

Instead of running-total you can use the following
cast (substring(roleValue ('_memberUniqueName',[Month]),63,6),integer)