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)
Pie Chart Aggregation
pmathieu
Greetings community:
What I'm looking to do is to configure my pie chart to only display the top 6 fields. The remaining fields should be aggregated into one section and labeled as "Other". I've tried playing with the "Minimum Slice" functionality but due to the dynamic nature of the data, it won't work as a permanent solution (image attached).
Thank you in advance for your assistance.
Patrick
Find more posts tagged with
Comments
kclark
I've attached an example of one way I was able to do this. I created two computed columns. The first one checks for the top n payments. In my example I limit to 6. The second computed column then sums all values that aren't the top n.<br />
<br />
Then I created a table with an aggregation field with running count. Then I applied a filter so the table on shows the top n values. And used this logic for the payments field<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(row["Aggregation"] == 6) {
row["largeAmount"]
}else{
dataSetRow["PMTS"]
}</pre>
<br />
This allows me to have the top 5 values in my table and the summed data that isn't top n as the 6th. Then I was able to create a pie chart using the table as the data set.<br />
<br />
The result ends up displaying the top 5 results and the 6th slice is the sum of all values that aren't top n.
pmathieu
Thank you kclark this helped a lot. I had to tweak the table organization as my table does not have a column that we're summing (like your PMTS column), rather, I had to group my values and use the "IS-TOP-N" functionality coupled with the running count. The check for row number and corresponding replacement was a big help (i.e):<br />
<br />
if(row["Aggregation"] == 6) {<br />
row["test"]<br />
}else{<br />
dataSetRow["PMTS"]<br />
}<br />
<br />
I had another issue with the same report that I posted <a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/29207-parameter-initialization-timing/page__p__116003&#entry116003'>here</a>
; (as it is a different problem):