COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: ratnalein on 04 Jul 2013 04:48:24 AM

Title: percentage
Post by: ratnalein on 04 Jul 2013 04:48:24 AM
Hallo everyone,

I was trying to build a percentage for a measure data element:


percentage([Number of sick People]/[Total number People])


It gives me the wrong percentage.  Mhh.. something wrong with the usage of percentage?

Thank you..

Regards,

Ratna :)
Title: Re: percentage
Post by: MKA on 04 Jul 2013 05:01:11 AM
Can't you just do the calculation in a data item and then set the format to percentage?
Title: Re: percentage
Post by: ratnalein on 04 Jul 2013 05:49:23 AM
Hallo MKA,

thank you for the quick reply.  I can not do it in the data item, because if I do that, the values appearing in my map legend will not be formatted automatically in percentage.  I need the values in the map legend to be in percentage.

Regards,

Ratna
Title: Re: percentage
Post by: Lynn on 08 Jul 2013 12:53:24 PM
The percentage function takes one numeric data item and returns the percentage for each occurrence based on the total of that same data item.

In the documentation example it shows 3 sales people, the sales for each, and then each sales person's percent of the total sales.

You are trying to get a percentage of one data item (sick people) relative to a different data item (total people).

I would do as MKA suggests. You can set the data format for the measure in your chart and that formatting should be reflected in the legend.