COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: bepanda on 13 Nov 2012 06:57:13 AM

Title: Help generating reports
Post by: bepanda on 13 Nov 2012 06:57:13 AM
Hi there. I'm new to Cognos 8 and I really need help generating a report. Any help would be greatly appreciated.

I have the following table:
date               action     product
oct 1, 2012    started   product1
nov1, 2012    started   product1
nov1, 2012    started   product2
dec1, 2012     started   product1

I would like to create a report that looks like this:

report data         Oct      Nov     Dec
product1              1          1         1     
product2              0         1         0
product3             0          0         0

This seems to be pretty straight forward. But I don't seem to be able to generate it. Can someone give me the steps by steps help to do it?
I believe I can do this using a Crosstab?   I would like to have the number of month be always 13 months running.



Thanks.
Title: Re: Help generating reports
Post by: blom0344 on 13 Nov 2012 09:36:08 AM
2 calculated dataitems additionally needed:


case when [action] = 'started' then 1 else 0 end



case
when extract(month,[date]) = 1 then 'Jan'
when extract(month,[date]) = 2 then 'Feb'
....
when extract(month,[date]) = 12 then 'Dec'
else null end


Build the crosstab making sure that you set an aggregate against the measure, otherwise the crosstab will remain empty
Title: Re: Help generating reports
Post by: bepanda on 13 Nov 2012 02:51:49 PM
Thanks for the help.
Yes , Indeed I get an empty crosstab. The months columns headers are display properly at the top of the table.
What do you mean to set an aggregate against the measure?
I tried a few things as the example below:

Code:[Select]
  count(if([action]='started') then 0 else 1)

Didn't make a difference. Still empty crosstab.
Title: Re: Help generating reports
Post by: blom0344 on 13 Nov 2012 02:54:21 PM
Cognos crosstabs only work with measures if the regular aggregate setting (properties!) is set. Coding this in the definition is not good enough!!

Check out the setting in properties!!
Title: Re: Help generating reports
Post by: bepanda on 13 Nov 2012 03:30:10 PM
Yahoo!!! it is working.
Thanks for your help.