Skip to main content



      Home
Home » Archived » BIRT » pie chart - groupin
pie chart - groupin [message #51022] Thu, 23 June 2005 21:10 Go to next message
Eclipse UserFriend
Originally posted by: junaili.gmail.com

Hi,
I have the following data:
cat val
--- ---
cat1 val1
cat1 val2
....
cat2 val1
cat2 val2
....
cat3 val3
....

I want to be able to create a pie chart for
cat count()
--- ----
cat1 45
cat2 32
cat3 92
cat4 1
cat5 3

The pie chart will have all count() >10 as part of the pieces. All the
other cat(s) that have count()<10 will be combined into something like
cat-other, and the count() will be the sum of count() of those cat (that
are less than 10).
Is this currently supported?

Any pointer will be much appreciated.
Thank you!
Re: pie chart - groupin [message #51245 is a reply to message #51022] Fri, 24 June 2005 09:51 Go to previous message
Eclipse UserFriend
Originally posted by: none.none.com

This is a multi-part message in MIME format.

------=_NextPart_000_014C_01C578D4.90A66130
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

The pie chart itself does not have this "min slice" feature, but you can =
achieve the same result using a dataset defined by the following SQL =
query:

select cat, sum (val) as sumval
from Table1

group by cat

having sum(val)>10

union

select 'others' as cat, sum (val) as sumval

from Table1 where cat in ( select cat from Table1

group by cat

having sum(val)<=3D10

)

group by 'others'


Then, just bind this dataset to the pie chart.

Thanks,

David


"J L" <junaili@gmail.com> wrote in message =
news:d9fmjf$ve$1@news.eclipse.org...
> Hi,
> I have the following data:
> cat val
> --- ---
> cat1 val1
> cat1 val2
> ...
> cat2 val1
> cat2 val2
> ...
> cat3 val3
> ...
>=20
> I want to be able to create a pie chart for
> cat count()
> --- ----
> cat1 45
> cat2 32
> cat3 92
> cat4 1
> cat5 3
>=20
> The pie chart will have all count() >10 as part of the pieces. All the =

> other cat(s) that have count()<10 will be combined into something like =

> cat-other, and the count() will be the sum of count() of those cat =
(that=20
> are less than 10).
> Is this currently supported?
>=20
> Any pointer will be much appreciated.
> Thank you!
------=_NextPart_000_014C_01C578D4.90A66130
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>The pie chart itself does not have this "min slice" =
feature,&nbsp;but you=20
can achieve the same result using a dataset defined by the following SQL =

query:</DIV>
<DIV><B><FONT color=3D#7f0055 size=3D2></FONT></B>&nbsp;</DIV>
<DIV><B><FONT color=3D#7f0055 size=3D2>select </B></FONT><FONT =
size=3D2>cat,=20
</FONT><B><FONT color=3D#7f0055 size=3D2>sum </B></FONT><FONT =
size=3D2>(val)=20
</FONT><B><FONT color=3D#7f0055 size=3D2>as </B></FONT><FONT =
size=3D2>sumval</DIV>
<DIV></FONT><B><FONT color=3D#7f0055 size=3D2>
<P>from </B></FONT><FONT size=3D2>Table1</P></FONT><B><FONT =
color=3D#7f0055 size=3D2>
<P>group by </B></FONT><FONT size=3D2>cat</P></FONT><B><FONT =
color=3D#7f0055 size=3D2>
<P>having </B></FONT><FONT size=3D2>sum(val)&gt;10</P></FONT><B><FONT=20
color=3D#7f0055 size=3D2>
<P>union</P>
<P>select </B></FONT><FONT color=3D#2a00ff size=3D2>'others'</FONT><FONT =
size=3D2>=20
</FONT><B><FONT color=3D#7f0055 size=3D2>as </B></FONT><FONT =
size=3D2>cat,=20
</FONT><B><FONT color=3D#7f0055 size=3D2>sum </B></FONT><FONT =
size=3D2>(val)=20
</FONT><B><FONT color=3D#7f0055 size=3D2>as </B></FONT><FONT=20
size=3D2>sumval</P></FONT><B><FONT color=3D#7f0055 size=3D2>
<P>from </B></FONT><FONT size=3D2>Table1 </FONT><B><FONT color=3D#7f0055 =

size=3D2>where </B></FONT><FONT size=3D2>cat </FONT><B><FONT =
color=3D#7f0055 size=3D2>in=20
</B></FONT><FONT size=3D2>( </FONT><B><FONT color=3D#7f0055 =
size=3D2>select=20
</B></FONT><FONT size=3D2>cat </FONT><B><FONT color=3D#7f0055 =
size=3D2>from=20
</B></FONT><FONT size=3D2>Table1</P></FONT><B><FONT color=3D#7f0055 =
size=3D2>
<P>group by </B></FONT><FONT size=3D2>cat</P></FONT><B><FONT =
color=3D#7f0055 size=3D2>
<P>having </B></FONT><FONT size=3D2>sum(val)&lt;=3D10</P>
<P>)</P></FONT><B><FONT color=3D#7f0055 size=3D2>
<P>group by </B></FONT><FONT color=3D#2a00ff =
size=3D2>'others'</FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>Then, just bind this dataset to the pie chart.</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>David</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>"J L" &lt;<A =
href=3D"mailto:junaili@gmail.com">junaili@gmail.com</A>&gt;=20
wrote in message <A=20
href=3D"news:d9fmjf$ve$1@news.eclipse.org">news:d9fmjf$ve$1@news.eclipse.=
org</A>...</DIV>&gt;=20
Hi,<BR>&gt; I have the following data:<BR>&gt; cat val<BR>&gt; --- =
---<BR>&gt;=20
cat1 val1<BR>&gt; cat1 val2<BR>&gt; ...<BR>&gt; cat2 val1<BR>&gt; cat2=20
val2<BR>&gt; ...<BR>&gt; cat3 val3<BR>&gt; ...<BR>&gt; <BR>&gt; I want =
to be=20
able to create a pie chart for<BR>&gt; cat count()<BR>&gt; --- =
----<BR>&gt; cat1=20
45<BR>&gt; cat2 32<BR>&gt; cat3 92<BR>&gt; cat4 1<BR>&gt; cat5 3<BR>&gt; =

<BR>&gt; The pie chart will have all count() &gt;10 as part of the =
pieces. All=20
the <BR>&gt; other cat(s) that have count()&lt;10 will be combined into=20
something like <BR>&gt; cat-other, and the count() will be the sum of =
count() of=20
those cat (that <BR>&gt; are less than 10).<BR>&gt; Is this currently=20
supported?<BR>&gt; <BR>&gt; Any pointer will be much =
appreciated.<BR>&gt; Thank=20
you!</BODY></HTML>

------=_NextPart_000_014C_01C578D4.90A66130--
Previous Topic:Hiding Border
Next Topic:Chart Error
Goto Forum:
  


Current Time: Sun May 11 08:32:24 EDT 2025

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

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

Back to the top