SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem in creating a Pie chart


Problem in creating a Pie chart

Author
Message
malavika.ramanathan
malavika.ramanathan
Mr or Mrs. 500
Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)Mr or Mrs. 500 (550 reputation)

Group: General Forum Members
Points: 550 Visits: 748
Hi All,

I have a table which stores values like Yes, Never and Close.

I need to display the % of each of them in a Pie chart.

my query is like:

select CONVERT(float,LC)/CONVERT(float,Total) as LC_Perc
,CONVERT(float,LY)/CONVERT(float,Total) as LY_Perc
,CONVERT(float,LN)/CONVERT(float,Total) as LN_Perc
from
(
select LC,LY,LN,LC+LY+LN as Total from
(
select sum(LessonClose) as LC,sum(LessonYes) as LY, sum(LessonNever) as LN
from Lessons
)tbl1

)tbl2


and the result set is :
LC_Perc----------LY_Perc--------LN_Perc
22%--------------18%-----------40%

I tried to plot these on the pie chart and m not getting the desired result. I get only one sector on the Pie. the other two are not mapping correctly.

Can we not display multiple columns on the same pie?

How can i solve this?

Please suggest. its bit urgent.

Thanks,
Malavika.

Please suggest something.
ldorian81
ldorian81
SSChasing Mays
SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)SSChasing Mays (603 reputation)

Group: General Forum Members
Points: 603 Visits: 335
Hi,

Did you manage to resolve this at all?
Or can anyone answer this?

Regards
ld

Stoke-on-Trent
United Kingdom

If at first you don't succeed, go to the pub and drink away your current thought plan.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search