COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: midhl on 24 Sep 2010 04:07:52 AM

Title: Could percentages be displayed along with counts in a crosstab
Post by: midhl on 24 Sep 2010 04:07:52 AM
Hi,
My  requirement is like this,i've got a value prompt and there are 10 values getting populated in the value prompt(Like City,Region,State,Job etc). So based on the value selected in the prompt,crosstab rows are getting displayed dynamically based on the selection in the prompt.

For ex if state is selected all the state wise counts  are displayed,likewise whatever values chosen inthe prompts their corresponding counts are shown,issue here is based on the values displayed corresponding percentages are to be displayed below each row of counts.
Ex:If State is chosen as prompt output should display

State               Count
Arizona             30
Arizona             % to be displayed(i.e count of arizona/Total count of all states)
NewJersey          40
NewJersey          %
Newyork             20
NewYork             %
likewise.

But the data in the data base is just counts of state or whatever value is selected in the prompt
(If state is selected as a prompt state wise counts displayed,if country selected country wise counts displayed)

Is it possible to display % as per the above requirement i.e along with the counts displayed could % of the values be displayed below the counts.If so could someone let me know how

Thanks in advance
Title: Re: Could percentages be displayed along with counts in a crosstab
Post by: MFGF on 29 Sep 2010 10:23:38 AM
Hi,

If I'm understanding correctly (which is very unusual for a muppet! :) ) you could try the following expression for your percentages:
[Count] / total([Count] for report)

Regards,

MF.