COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: mel4363 on 17 Jul 2014 12:21:44 PM

Title: Using Layout calculation in chart
Post by: mel4363 on 17 Jul 2014 12:21:44 PM
Hi everyone,

I have a report reporting of a SQL database, I wanted to calculate average based on the number of items selected in the prompt page (Months). I was able to achieve this by using a layout calculation on the crosstab using ParamCount(Month) function.

My challange now however is that I have to use the same item on a pie chart but I get an error when attempting to insert a Layout calculation in the default measure. Is the a way around this? or a different solution ?

Thank you in advance

Mel
Title: Re: Using Layout calculation in chart
Post by: MFGF on 17 Jul 2014 12:32:01 PM
Quote from: mel4363 on 17 Jul 2014 12:21:44 PM
Hi everyone,

I have a report reporting of a SQL database, I wanted to calculate average based on the number of items selected in the prompt page (Months). I was able to achieve this by using a layout calculation on the crosstab using ParamCount(Month) function.

My challange now however is that I have to use the same item on a pie chart but I get an error when attempting to insert a Layout calculation in the default measure. Is the a way around this? or a different solution ?

Thank you in advance

Mel

Hi,

Layout calculations are (as the name suggests) intended to be used in the report layout areas (ie places like the page header or page footer). If you want to define a calculation in a reporting object which is associated with a query (eg list/crosstab/chart etc) you need to use a Query calculation.

If you want to know how many items were selected in the prompt, all you need to do is to count the number of months displayed in your reporting object in a query calculation

eg count([your month item] for report)

You should have no issues bringing a query calculation into your pie chart.

Cheers!

MF.
Title: Re: Using Layout calculation in chart
Post by: mel4363 on 17 Jul 2014 12:45:06 PM
Thanks a lot MF. It worked.

I had not included the report at the end of my calculation

Thanks again

Mel