Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Area Chart - Only show top 5 and summation of remainder
Area Chart - Only show top 5 and summation of remainder [message #888828] Mon, 18 June 2012 17:18 Go to next message
Ronan Murphy is currently offline Ronan Murphy
Messages: 4
Registered: June 2012
Junior Member
Hi all,

I'm trying to create a percentage area chart or stacked bar chart that will show the grouped results of only the top 5 groups (ideally by the sum of the entire date range) and a summation of all other groups. Showing all the groups makes the chart illegible.

The input data is a variable number of groups and different group titles, depending on user selection. I currently have a chart that is using the Optional Y Series Grouping and sorting by quantum, but can't find a way to only show top 5 groups.

I'm using BIRT 3.7.2

All thoughts and ideas welcome!
Thanks for the help
Re: Area Chart - Only show top 5 and summation of remainder [message #888969 is a reply to message #888828] Mon, 18 June 2012 20:51 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Have you tried to use a top N filter on the chart?

Jason

On 6/18/2012 1:18 PM, Ronan Murphy wrote:
> Hi all,
>
> I'm trying to create a percentage area chart or stacked bar chart that
> will show the grouped results of only the top 5 groups (ideally by the
> sum of the entire date range) and a summation of all other groups.
> Showing all the groups makes the chart illegible.
> The input data is a variable number of groups and different group
> titles, depending on user selection. I currently have a chart that is
> using the Optional Y Series Grouping and sorting by quantum, but can't
> find a way to only show top 5 groups.
> I'm using BIRT 3.7.2
>
> All thoughts and ideas welcome!
> Thanks for the help
Re: Area Chart - Only show top 5 and summation of remainder [message #888994 is a reply to message #888969] Mon, 18 June 2012 21:24 Go to previous messageGo to next message
Ronan Murphy is currently offline Ronan Murphy
Messages: 4
Registered: June 2012
Junior Member
I have tried that and had some issues. My chart is set up as:
X-axis: dates
Y-axis: sales volume (integer)
Y-Grouping: product (string) (Sorted descending on sales volume)

I have the filter set up on Product - Top n - report parameter (integer)

However this always gives me a single Product category rather than top 5. I also tried it unsorted and get same result.

Will the top n filter also give me (or is it possible to include) a summation of all the categories that are not in the top 5? As we are looking at percentage area charts we would misrepresent the data otherwise, and it is an important element of the report.

Apologies if it is a rudimentary question, I'm new to the program!

Thanks again



Jason Weathersby wrote on Mon, 18 June 2012 16:51
Have you tried to use a top N filter on the chart?

Jason

On 6/18/2012 1:18 PM, Ronan Murphy wrote:
> Hi all,
>
> I'm trying to create a percentage area chart or stacked bar chart that
> will show the grouped results of only the top 5 groups (ideally by the
> sum of the entire date range) and a summation of all other groups.
> Showing all the groups makes the chart illegible.
> The input data is a variable number of groups and different group
> titles, depending on user selection. I currently have a chart that is
> using the Optional Y Series Grouping and sorting by quantum, but can't
> find a way to only show top 5 groups.
> I'm using BIRT 3.7.2
>
> All thoughts and ideas welcome!
> Thanks for the help

Re: Area Chart - Only show top 5 and summation of remainder [message #889253 is a reply to message #888994] Tue, 19 June 2012 04:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This is most likely because the filter is happening before the
aggregation. Take a look at the topn example attached that aggregates
in the data set and then filters on the chart.

Jason


On 6/18/2012 5:24 PM, Ronan Murphy wrote:
> I have tried that and had some issues. My chart is set up as:
> X-axis: dates
> Y-axis: sales volume (integer)
> Y-Grouping: product (string) (Sorted descending on sales volume)
>
> I have the filter set up on Product - Top n - report parameter (integer)
>
> However this always gives me a single Product category rather than top
> 5. I also tried it unsorted and get same result.
>
> Will the top n filter also give me (or is it possible to include) a
> summation of all the categories that are not in the top 5? As we are
> looking at percentage area charts we would misrepresent the data
> otherwise, and it is an important element of the report.
>
> Apologies if it is a rudimentary question, I'm new to the program!
> Thanks again
>
>
>
> Jason Weathersby wrote on Mon, 18 June 2012 16:51
>> Have you tried to use a top N filter on the chart?
>>
>> Jason
>>
>> On 6/18/2012 1:18 PM, Ronan Murphy wrote:
>> > Hi all,
>> >
>> > I'm trying to create a percentage area chart or stacked bar chart that
>> > will show the grouped results of only the top 5 groups (ideally by the
>> > sum of the entire date range) and a summation of all other groups.
>> > Showing all the groups makes the chart illegible.
>> > The input data is a variable number of groups and different group
>> > titles, depending on user selection. I currently have a chart that is
>> > using the Optional Y Series Grouping and sorting by quantum, but can't
>> > find a way to only show top 5 groups.
>> > I'm using BIRT 3.7.2
>> >
>> > All thoughts and ideas welcome!
>> > Thanks for the help
>
>
Re: Area Chart - Only show top 5 and summation of remainder [message #889257 is a reply to message #888994] Tue, 19 June 2012 04:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This is most likely because the filter is happening before the
aggregation. Take a look at the topn example attached that aggregates
in the data set and then filters on the chart.

Jason


On 6/18/2012 5:24 PM, Ronan Murphy wrote:
> I have tried that and had some issues. My chart is set up as:
> X-axis: dates
> Y-axis: sales volume (integer)
> Y-Grouping: product (string) (Sorted descending on sales volume)
>
> I have the filter set up on Product - Top n - report parameter (integer)
>
> However this always gives me a single Product category rather than top
> 5. I also tried it unsorted and get same result.
>
> Will the top n filter also give me (or is it possible to include) a
> summation of all the categories that are not in the top 5? As we are
> looking at percentage area charts we would misrepresent the data
> otherwise, and it is an important element of the report.
>
> Apologies if it is a rudimentary question, I'm new to the program!
> Thanks again
>
>
>
> Jason Weathersby wrote on Mon, 18 June 2012 16:51
>> Have you tried to use a top N filter on the chart?
>>
>> Jason
>>
>> On 6/18/2012 1:18 PM, Ronan Murphy wrote:
>> > Hi all,
>> >
>> > I'm trying to create a percentage area chart or stacked bar chart that
>> > will show the grouped results of only the top 5 groups (ideally by the
>> > sum of the entire date range) and a summation of all other groups.
>> > Showing all the groups makes the chart illegible.
>> > The input data is a variable number of groups and different group
>> > titles, depending on user selection. I currently have a chart that is
>> > using the Optional Y Series Grouping and sorting by quantum, but can't
>> > find a way to only show top 5 groups.
>> > I'm using BIRT 3.7.2
>> >
>> > All thoughts and ideas welcome!
>> > Thanks for the help
>
>
Re: Area Chart - Only show top 5 and summation of remainder [message #889261 is a reply to message #888994] Tue, 19 June 2012 04:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This is most likely because the filter is happening before the
aggregation. Take a look at the topn example attached that aggregates
in the data set and then filters on the chart.

Jason


On 6/18/2012 5:24 PM, Ronan Murphy wrote:
> I have tried that and had some issues. My chart is set up as:
> X-axis: dates
> Y-axis: sales volume (integer)
> Y-Grouping: product (string) (Sorted descending on sales volume)
>
> I have the filter set up on Product - Top n - report parameter (integer)
>
> However this always gives me a single Product category rather than top
> 5. I also tried it unsorted and get same result.
>
> Will the top n filter also give me (or is it possible to include) a
> summation of all the categories that are not in the top 5? As we are
> looking at percentage area charts we would misrepresent the data
> otherwise, and it is an important element of the report.
>
> Apologies if it is a rudimentary question, I'm new to the program!
> Thanks again
>
>
>
> Jason Weathersby wrote on Mon, 18 June 2012 16:51
>> Have you tried to use a top N filter on the chart?
>>
>> Jason
>>
>> On 6/18/2012 1:18 PM, Ronan Murphy wrote:
>> > Hi all,
>> >
>> > I'm trying to create a percentage area chart or stacked bar chart that
>> > will show the grouped results of only the top 5 groups (ideally by the
>> > sum of the entire date range) and a summation of all other groups.
>> > Showing all the groups makes the chart illegible.
>> > The input data is a variable number of groups and different group
>> > titles, depending on user selection. I currently have a chart that is
>> > using the Optional Y Series Grouping and sorting by quantum, but can't
>> > find a way to only show top 5 groups.
>> > I'm using BIRT 3.7.2
>> >
>> > All thoughts and ideas welcome!
>> > Thanks for the help
>
>
Re: Area Chart - Only show top 5 and summation of remainder [message #889265 is a reply to message #888994] Tue, 19 June 2012 04:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

This is most likely because the filter is happening before the
aggregation. Take a look at the topn example attached that aggregates
in the data set and then filters on the chart.

Jason


On 6/18/2012 5:24 PM, Ronan Murphy wrote:
> I have tried that and had some issues. My chart is set up as:
> X-axis: dates
> Y-axis: sales volume (integer)
> Y-Grouping: product (string) (Sorted descending on sales volume)
>
> I have the filter set up on Product - Top n - report parameter (integer)
>
> However this always gives me a single Product category rather than top
> 5. I also tried it unsorted and get same result.
>
> Will the top n filter also give me (or is it possible to include) a
> summation of all the categories that are not in the top 5? As we are
> looking at percentage area charts we would misrepresent the data
> otherwise, and it is an important element of the report.
>
> Apologies if it is a rudimentary question, I'm new to the program!
> Thanks again
>
>
>
> Jason Weathersby wrote on Mon, 18 June 2012 16:51
>> Have you tried to use a top N filter on the chart?
>>
>> Jason
>>
>> On 6/18/2012 1:18 PM, Ronan Murphy wrote:
>> > Hi all,
>> >
>> > I'm trying to create a percentage area chart or stacked bar chart that
>> > will show the grouped results of only the top 5 groups (ideally by the
>> > sum of the entire date range) and a summation of all other groups.
>> > Showing all the groups makes the chart illegible.
>> > The input data is a variable number of groups and different group
>> > titles, depending on user selection. I currently have a chart that is
>> > using the Optional Y Series Grouping and sorting by quantum, but can't
>> > find a way to only show top 5 groups.
>> > I'm using BIRT 3.7.2
>> >
>> > All thoughts and ideas welcome!
>> > Thanks for the help
>
>
Re: Area Chart - Only show top 5 and summation of remainder [message #889787 is a reply to message #889253] Tue, 19 June 2012 15:14 Go to previous messageGo to next message
Ronan Murphy is currently offline Ronan Murphy
Messages: 4
Registered: June 2012
Junior Member
Jason,

That makes sense and when I checked it is the issue. Unfortunately I'm complicating this as I'm working off a database join and need the extra column that would be aggregated out to do the join on.

Sounds like I'll need to find another approach to present the data.

Thanks for the help
Re: Area Chart - Only show top 5 and summation of remainder [message #889844 is a reply to message #889787] Tue, 19 June 2012 21:43 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Ronan,

There are other ways around this all though it may involve a bit of
scripting. In fact you can replace all of the data a chart uses at run
time. I am not certain you want to do this. If you need some kind of
example let me know. BTW pie charts have min slice value that combines
smaller values into a "others" type category as well.

Jason

On 6/19/2012 11:14 AM, Ronan Murphy wrote:
> Jason,
>
> That makes sense and when I checked it is the issue. Unfortunately I'm
> complicating this as I'm working off a database join and need the extra
> column that would be aggregated out to do the join on.
>
> Sounds like I'll need to find another approach to present the data.
>
> Thanks for the help
Re: Area Chart - Only show top 5 and summation of remainder [message #889845 is a reply to message #889844] Tue, 19 June 2012 21:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BTW another more elegant solution is to create a birt data cube off of
the data set and then drag the cube to the report. Ann a filter to it
and then convert it to a chart view. Take a look at the attached example.

Jason


On 6/19/2012 5:43 PM, Jason Weathersby wrote:
> Ronan,
>
> There are other ways around this all though it may involve a bit of
> scripting. In fact you can replace all of the data a chart uses at run
> time. I am not certain you want to do this. If you need some kind of
> example let me know. BTW pie charts have min slice value that combines
> smaller values into a "others" type category as well.
>
> Jason
>
> On 6/19/2012 11:14 AM, Ronan Murphy wrote:
>> Jason,
>>
>> That makes sense and when I checked it is the issue. Unfortunately I'm
>> complicating this as I'm working off a database join and need the extra
>> column that would be aggregated out to do the join on.
>>
>> Sounds like I'll need to find another approach to present the data.
>>
>> Thanks for the help
>
Re: Area Chart - Only show top 5 and summation of remainder [message #889846 is a reply to message #889844] Tue, 19 June 2012 21:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BTW another more elegant solution is to create a birt data cube off of
the data set and then drag the cube to the report. Ann a filter to it
and then convert it to a chart view. Take a look at the attached example.

Jason


On 6/19/2012 5:43 PM, Jason Weathersby wrote:
> Ronan,
>
> There are other ways around this all though it may involve a bit of
> scripting. In fact you can replace all of the data a chart uses at run
> time. I am not certain you want to do this. If you need some kind of
> example let me know. BTW pie charts have min slice value that combines
> smaller values into a "others" type category as well.
>
> Jason
>
> On 6/19/2012 11:14 AM, Ronan Murphy wrote:
>> Jason,
>>
>> That makes sense and when I checked it is the issue. Unfortunately I'm
>> complicating this as I'm working off a database join and need the extra
>> column that would be aggregated out to do the join on.
>>
>> Sounds like I'll need to find another approach to present the data.
>>
>> Thanks for the help
>
Re: Area Chart - Only show top 5 and summation of remainder [message #890210 is a reply to message #889846] Thu, 21 June 2012 13:20 Go to previous messageGo to next message
Ronan Murphy is currently offline Ronan Murphy
Messages: 4
Registered: June 2012
Junior Member
Jason,

A very elegant solution! Thank you for the help.


Jason Weathersby wrote on Tue, 19 June 2012 17:48
BTW another more elegant solution is to create a birt data cube off of
the data set and then drag the cube to the report. Ann a filter to it
and then convert it to a chart view. Take a look at the attached example.

Jason


On 6/19/2012 5:43 PM, Jason Weathersby wrote:
> Ronan,
>
> There are other ways around this all though it may involve a bit of
> scripting. In fact you can replace all of the data a chart uses at run
> time. I am not certain you want to do this. If you need some kind of
> example let me know. BTW pie charts have min slice value that combines
> smaller values into a "others" type category as well.
>
> Jason
>
> On 6/19/2012 11:14 AM, Ronan Murphy wrote:
>> Jason,
>>
>> That makes sense and when I checked it is the issue. Unfortunately I'm
>> complicating this as I'm working off a database join and need the extra
>> column that would be aggregated out to do the join on.
>>
>> Sounds like I'll need to find another approach to present the data.
>>
>> Thanks for the help
>

Re: Area Chart - Only show top 5 and summation of remainder [message #1058004 is a reply to message #890210] Fri, 10 May 2013 13:08 Go to previous messageGo to next message
Shane Manning is currently offline Shane Manning
Messages: 3
Registered: May 2013
Junior Member
This has been very helpful, but I am still not sure how to add a piece to the pie chart showing the values of everything other than the Top N. How do I add in the script for that?
Re: Area Chart - Only show top 5 and summation of remainder [message #1058049 is a reply to message #1058004] Fri, 10 May 2013 15:50 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1639
Registered: July 2009
Senior Member

So, you want to have a slice for each of the top N, then have a slice for "everything else" as well? What's your BIRT version?

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Area Chart - Only show top 5 and summation of remainder [message #1058052 is a reply to message #1058049] Fri, 10 May 2013 16:09 Go to previous messageGo to next message
Shane Manning is currently offline Shane Manning
Messages: 3
Registered: May 2013
Junior Member
Yes, that is exactly what I want. I found another post that explained how to change the minimum slice size with a script, but I cannot figure out how to get the size of the value from the crosstab of the Nth value.

I tried doing this in the crosstab:
function onCreateCell( cellInst, reportContext )
{
if( cellInst.getCellType() == "measures")
{
importPackage(Packages.java.lang );
var cur = cellInst.getDataValue("Incident Number");
if( reportContext.getGlobalVariable("min_inc")==null)
reportContext.setGlobalVariable("min_inc",cur);
}
}

But, I do not get any value in min_inc.

I am using BIRT version 2.5.1.
Re: Area Chart - Only show top 5 and summation of remainder [message #1058177 is a reply to message #888828] Mon, 13 May 2013 04:52 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1639
Registered: July 2009
Senior Member

Take a look at this report.



Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Area Chart - Only show top 5 and summation of remainder [message #1058279 is a reply to message #1058177] Mon, 13 May 2013 12:53 Go to previous messageGo to next message
Shane Manning is currently offline Shane Manning
Messages: 3
Registered: May 2013
Junior Member
Thank you - that worked perfectly and was a much cleaner solution than what I was trying.
Re: Area Chart - Only show top 5 and summation of remainder [message #1058414 is a reply to message #1058279] Tue, 14 May 2013 04:12 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1639
Registered: July 2009
Senior Member

Great! Glad to help! Let us know whenever you have questions! Smile

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:Debug perspective with "scriptlib" folder
Next Topic:Difference between consecutive rows(next-current)
Goto Forum:
  


Current Time: Fri Oct 31 06:30:45 GMT 2014

Powered by FUDForum. Page generated in 0.21291 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software