Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Sort and Display top N aggregated data in stacked bar chart
lcooley11
I need advice on charting. I hava a stacked bar chart with category X series as ItemX, Y value series is aggregation on Count of ItemX, and Optional Y grouping is color of ItemX. I would like to sort the aggregated values from high to low, left to right along the X axis, but I only see sorting as possible on the ItemX (alphabetical). For example, if ItemX is types of cars, Y value is total count of each type of car, and optional grouping is car color, I would like to see left to right the highest total number of car to the lowest number of cars, and then also take only the top 10 to display. Is there a way to do this through the Chart editor, or do I need to do this some other way? I am using 2.6. Thank you!
Find more posts tagged with
Comments
RichT
Good Morning,<br />
<br />
This post may provide a solution for you.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/23354-sorting-x-axis-series-in-a-line-chart-with-y-series-grouping/page__pid__93955__st__0&#entry93955'>23354-sorting-x-axis-series-in-a-line-chart-with-y-series-grouping</a><br
/>
<br />
As far as the top 10 results...I usually restrict it in the dataset query but, using the approach mwilliams suggests in the link above, you could evaluate the x value and hide everything greater than 10<br />
<br />
Hope it helps,<br />
Rich
johnw
I'm sorry I didnt catch this earlier. I actually wrote up an example for this as an exercise for EclipseCon.
The way you can do this is to use a table, and sort it, and use an aggregtation with the IsTopN (or IsTopNPercent) function. In the chart, you just filter based on the result of the IsTopN aggregation. Take a look at the following example. It uses two tables, except one is filtering on Top10 and used to source the chart.
lcooley11
Thank for your input but I am not clear how this solves the problem.
I want to display a stacked chart with an optional y-series grouping, and display the top n for the total of each y value of the stacked chart. So in your example, If the Total Orders had a y-series grouping of the orders broken down into products and shown as a stacked bar for each customer, how can you display only the top n total orders?
I have looked at the example from mwilliams as suggested by Tilley113 post, but it isn't exactly the same issue either.
Any help/suggestions are greatly appreciated!