BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need TDBChart help (displaying query results)

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Crazy Horse's crazier lit
Guest





PostPosted: Tue Apr 26, 2005 2:34 pm    Post subject: Need TDBChart help (displaying query results) Reply with quote



I want to display, in a bar chart, data respecting hiring decisions by
gender.

There should be two bars: one representing male, one female.

On each bar, I want to have colored sections that show what % of each type
of hiring action occurred for that gender.

For example, the Male bar may represent 42 applicants, 10 of which were
hired, 12 of which were interviewed but not hired, and 20 of which were not
interviewed; the Female bar may represent 96 applicants, 36 of which were
hired, 24 of which were interviewed but not hired, and 36 of which were not
interviewed.

What settings must I set/what hoops must I jump through, to get this to
work?

I should be able to feed the necessary data to the TDBChart with the
following SQL:

SELECT
a.gender,
a.ACTIONCODE,
Count(*)
FROM
HR_APPLICANTS a
GROUP BY
a.gender,
a.ACTIONCODE

I just don't know how I need to tweak the component to get it to dance to my
tune.

--

Download Blackbird Crow Raven's book
"STILL CASTING SHADOWS: Two American Families 1620-2006"
(.exe and Delphi source): http://cc.borland.com/ccweb.exe/listing?id=23106


Back to top
Crazy Horse's crazier lit
Guest





PostPosted: Tue Apr 26, 2005 4:14 pm    Post subject: Re: Need TDBChart help (displaying query results) Reply with quote



"Crazy Horse's crazier little brother" <cshannon (AT) d4sw (DOT) com> wrote

Quote:
I want to display, in a bar chart, data respecting hiring decisions by
gender.

<snip>

Quote:
I should be able to feed the necessary data to the TDBChart with the
following SQL:

<Original SQL snipped>

Another possible SQL that I can use is:

select distinct
a.gender,
(select count(*) from HR_APPLICANTS where actioncode = 1 and
gender=a.gender) as hired,
(select count(*) from HR_APPLICANTS where actioncode = 2 and
gender=a.gender) as interviewed_declinedoffer,
(select count(*) from HR_APPLICANTS where actioncode = 3 and
gender=a.gender) as interviewed_nooffer,
(select count(*) from HR_APPLICANTS where actioncode = 4 and
gender=a.gender) as not_interviewed,
(select count(*) from HR_APPLICANTS where actioncode = 5 and
gender=a.gender) as phone_interview,
(select count(*) from HR_APPLICANTS where actioncode = 6 and
gender=a.gender) as declined_interview,
(select count(*) from HR_APPLICANTS where actioncode = 7 and
gender=a.gender) as temp_placement,
(select count(*) from HR_APPLICANTS where actioncode = 8 and
gender=a.gender) as leftmsg_noreturn,
(select count(*) from HR_APPLICANTS where actioncode = 9 and
gender=a.gender) as wore_the_wrong_color_socks
from hr_applicants a
group by a.gender

....if this would make it easier to make this data display in a sensible way
with the Chart.

--

Download Blackbird Crow Raven's book
"STILL CASTING SHADOWS: Two American Families 1620-2006"
(.exe and Delphi source): http://cc.borland.com/ccweb.exe/listing?id=23106



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.