COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sspk on 19 Jun 2008 10:39:06 AM

Title: xtab report
Post by: sspk on 19 Jun 2008 10:39:06 AM
Hi All,
I have a cross tab report in which the rows have data items like division and molecule and in the columns i have year and qtr and measures are dollars and Qty.And now i want to display some thing like previous year full total(not qtr wise) and current year in  qtr's.
I did like discontinuous xtab like dropping the qtr at the end .But it is displaying the qtr's of the previous year itself.Any ideas will help me alot  :-\
Title: Re: xtab report
Post by: blom0344 on 19 Jun 2008 02:15:14 PM
Use a union on 2 seperate queries:

1. Select [Rowitem1],[Rowitem2],[quarter], sum[quantity] from table where year = 2008
group by [Rowitem1],[Rowitem2],[quarter]


2. Select [Rowitem1],[Rowitem2],'Last year' ,sum[quantity] from table where year = 2007
group by [Rowitem1],[Rowitem2],'Last year'

(Assuming that [quarter] is a string value)

Now you should only use the query item that is associated with the quarter as a column.

Title: Re: xtab report
Post by: sspk on 24 Jun 2008 11:49:08 AM
Quote from: blom0344 on 19 Jun 2008 02:15:14 PM
Use a union on 2 seperate queries:

1. Select [Rowitem1],[Rowitem2],[quarter], sum[quantity] from table where year = 2008
group by [Rowitem1],[Rowitem2],[quarter]


2. Select [Rowitem1],[Rowitem2],'Last year' ,sum[quantity] from table where year = 2007
group by [Rowitem1],[Rowitem2],'Last year'

(Assuming that [quarter] is a string value)

Now you should only use the query item that is associated with the quarter as a column.


Thanks for the response, it  helped me alot
Title: Re: xtab report
Post by: sspk on 30 Jun 2008 08:51:20 AM
Quote from: scognos07 on 24 Jun 2008 11:49:08 AM
Thanks for the response, it  helped me alot


HI,
I have to add a calculated query item (% gross=total([dollars]/total([dollars] for [division]) ) .But this is giving correct values for year wise query .But i am un able to get % gross for qtr wise query.
Any ideas will help me.