pie chart - groupin [message #51022] |
Thu, 23 June 2005 21:10  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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> </DIV>
<DIV>The pie chart itself does not have this "min slice" =
feature, 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> </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)>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)<=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> </DIV>
<DIV>Then, just bind this dataset to the pie chart.</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>Thanks,</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>David</DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>"J L" <<A =
href=3D"mailto:junaili@gmail.com">junaili@gmail.com</A>>=20
wrote in message <A=20
href=3D"news:d9fmjf$ve$1@news.eclipse.org">news:d9fmjf$ve$1@news.eclipse.=
org</A>...</DIV>>=20
Hi,<BR>> I have the following data:<BR>> cat val<BR>> --- =
---<BR>>=20
cat1 val1<BR>> cat1 val2<BR>> ...<BR>> cat2 val1<BR>> cat2=20
val2<BR>> ...<BR>> cat3 val3<BR>> ...<BR>> <BR>> I want =
to be=20
able to create a pie chart for<BR>> cat count()<BR>> --- =
----<BR>> cat1=20
45<BR>> cat2 32<BR>> cat3 92<BR>> cat4 1<BR>> cat5 3<BR>> =
<BR>> The pie chart will have all count() >10 as part of the =
pieces. All=20
the <BR>> other cat(s) that have count()<10 will be combined into=20
something like <BR>> cat-other, and the count() will be the sum of =
count() of=20
those cat (that <BR>> are less than 10).<BR>> Is this currently=20
supported?<BR>> <BR>> Any pointer will be much =
appreciated.<BR>> Thank=20
you!</BODY></HTML>
------=_NextPart_000_014C_01C578D4.90A66130--
|
|
|
Powered by
FUDForum. Page generated in 0.04466 seconds