 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Crazy Horse's crazier lit Guest
|
Posted: Tue Apr 26, 2005 2:34 pm Post subject: Need TDBChart help (displaying query results) |
|
|
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
|
Posted: Tue Apr 26, 2005 4:14 pm Post subject: Re: Need TDBChart help (displaying query results) |
|
|
"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 |
|
 |
|
|
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
|
|