COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Neelam Bhatia on 30 Jun 2014 03:10:09 AM

Title: Data not displaying in pie chart (Active report)
Post by: Neelam Bhatia on 30 Jun 2014 03:10:09 AM
I have 1 requirement to show male/female count ratio in pie chart in Active report. i have gender field in my query.
for to achieve this i have created dataitem male and female.
1)expression defination of Male dataitem- if ( [Gender] ='male') then
([Employee ID] )
else (NULL)

2)expression defination of Female dataitem- if ( [Gender] ='Female') then
([Employee ID] )
else (NULL)

Then i created 2 more data items as Male count and Female count.
1) expression defination of Malecount dataitem-count(distinct[male])
2) expression defination of Femalecount dataitem-count(distinct[Female])

finally i added Malecount and Femalecount dataitems in  series of pie chart but iam getting No Data Available error.

Can someone please help me with this.



Title: Re: Data not displaying in pie chart (Active report)
Post by: cognos_learning on 30 Jun 2014 04:34:41 AM
Hi,

try the following logic:

For Male dataitem-
if ( [Gender] ='male') then
distinct-count([Employee ID] and  [Employee ID] is not null )
else (NULL)

2)expression defination of Female dataitem- if ( [Gender] ='Female' and [Employee ID] is not null) then
distinct-count([Employee ID])
else (NULL)


Thanks
Kumar_CognosDeveloper
Title: Re: Data not displaying in pie chart (Active report)
Post by: Ammus1234 on 30 Jun 2014 04:57:54 AM
Check the Aggregate function for the data items.

I may do it in a different way.

if ( [Gender] ='male') then
(1)
else (0)

then make the Aggregate function as Total
Title: Re: Data not displaying in pie chart (Active report)
Post by: Satheesh on 01 Jul 2014 09:40:30 AM
Hi,


1. Are you using any Category Axis...?


2. Can I Know what is Category Axis, Series, Measure...?


If you are using only Gender data Item..
Just do the following


Take a Query
1. Drag [Gender] Data item
2. Drag Data item from toolbox and type 1 click ok. Make the data type name Total. make Aggregation Function is Total.
3. Drag & Drop Pie Chart. Gender Data Item in Series and Total data item in Measure. in Chart properties Click on Show Value, Under Values Select Percentage.
4. Run




Thanks & Regards
Satheesh Chapparapu









Title: Re: Data not displaying in pie chart (Active report)
Post by: weapamela on 21 Feb 2018 01:23:52 PM
Hope you don't mind if I post on this discussion, I can't seem to find how to post a new topic.

I'm having similar issue, I'm using a data item like this one
total([Count measure] ) / total(total([Count measure]) )for report)

I'm trying to add this data item to a pie chart (which should display the % ), returns with 'no data'. 
If I remove the 'for report' returns with data (not the correct calculation but returns)

Suggestions, thanks and sorry to jump in on another post.
Title: Re: Data not displaying in pie chart (Active report)
Post by: MFGF on 22 Feb 2018 02:08:23 AM
Quote from: weapamela on 21 Feb 2018 01:23:52 PM
Hope you don't mind if I post on this discussion, I can't seem to find how to post a new topic.

Take a look at the FAQ post here (http://www.cognoise.com/index.php/topic,27563.0.html) - FAQ #3 gives you exact details on how to post a new topic.

Cheers!

MF.