COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: hisxlnc on 15 Jan 2009 03:07:42 AM

Title: Implementing % change Calculation in Cognos Report Studio
Post by: hisxlnc on 15 Jan 2009 03:07:42 AM
I have a report where I am currently having City , Month and Sales(in $) calculation. I need to another '% change of Sales' calculation on the report which is defined as

% Change
= ((Current Month Sales â€" Prior Month Sales)/Prior Month Sales )* 100


Please advice how to do it.

Thanks in advance.
Title: Re: Implementing % change Calculation in Cognos Report Studio
Post by: wyconian on 15 Jan 2009 03:41:51 AM
Hi

Are you using DMR or a relational data source?

If you have DMR and have the current_month and prior_month as data items the calculation is pretty simple using a tuple comand something like

You will need to use a crosstab for this

((tuple([current_month],[sales])-tuple([prior_month],[sales]))/tuple([prior_month],[sales]))*100

If you're not using DMR you will probably need to have a couple of sub queries one with current month sales and the other with prior month sales, bring them into a crosstab and then use a similar calculation to the one above
Title: Re: Implementing % change Calculation in Cognos Report Studio
Post by: hisxlnc on 15 Jan 2009 04:35:04 AM
Hi wyconian , thanks a lot for the reply.

I am using a DMR. Can the calculation be used on a List report or does it have to be a Crosstab?
Title: Re: Implementing % change Calculation in Cognos Report Studio
Post by: wyconian on 27 Jan 2009 02:29:28 AM
Hi

I think you need to use a crosstab but I could be wrong