If you are unable to create a new account, please email support@bspsoftware.com

 

Pie chart does not display based on the data in a list from the same query

Started by cwillard, 06 Feb 2017 08:16:49 AM

Previous topic - Next topic

cwillard

I am trying to create a pie chart showing the percentage of towns that have a median income higher than the state median income but the chart results do not match the list result from the same query.  My first query pulls the community geography description, the community median income and the state median income.  I then added a data item that compares the community to the state and returns a higher or lower value.  I also added a data item, call count_value with the number 1 in it.  The higher/lower data item is set to automatic for the Aggregation and roll-up aggregation and the value_count is set to total. 

I then added a second query that aggregates query 1.  Query two only contains the higher/lower data item and the count_value data item.  In query two I set the aggregation and roll-up aggregation to none for the higher/lower data item and to total for the count_value data item. When I view query 2 in tabular view or a list it correctly returns two rows showing  a total of 229 for higher and 122 for lower.  When I add a pie chart the pie chart shows 350 lower and 1 higher.  This is from the same query 2 that is displaying correctly in the list.  I would expect the chart to show 65% for higher and 35% for lower.  I also tried a bar chart and it also show 350 for lower and 1 for higher.

Any suggestions on what I might be doing wrong would be greatly appreciated.

a-oh-river

I am having this same exact issue trying to display what percentage of our projects are over or under budget.

hespora

likely something off with the aggregate function of your measure. If you, like the op, tried with an aggregate function of "none", try setting that to total instead, and the rollup aggregate to automatic.

Invisi

I experience issues with different chart types when relying on the default aggregations by Cognos. The list shows the correct numbers but the graph stays empty. I usually solve this by putting the aggregation (e.g. total, count) into the data item and then it works.

If I understand you right, you are using a pie chart to show 1 percentage? So 2 'values', the percentage above and the percentage below?
Few can be done on Cognos | RTFM for those who ask basic questions...

a-oh-river

@Invisi  - not sure if you were replying to me or to OP.

I'm use a Pie Chart to show 3 percentages. The percentage of projects that are over budget, under budget, and "on target".

What I did was created and expression to count whenever each value appears. So there are three columns with a variation of this expression (which is for my "Under Budget" projects):

Name: Under Count
CASE
WHEN [Budget] > [Total Actual Labor Cost] THEN 1
ELSE 0
END

Then I wrote a count expression for each:

Name: Under Total
count([Under Count])

I don't know if I am on the right track here.

Invisi

I'm replying to the original poster. But if you feel triggered by my question about the use of pie charts, feel free. ;)
Few can be done on Cognos | RTFM for those who ask basic questions...