Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Count and Percentage of skill ratings

Author  Topic 

mgarret
Starting Member

14 Posts

Posted - 2013-07-21 : 13:11:26
I have a program which brings in Skill ratings for an assesmnet people with the title of "Worker have to take aolng with a file number they are assigned. The program also being in the reporting line that each worker is a part of.

SELECT distinct
o.VP,
o.AVP,
o.Director,
o.Supervisor,
o.Worker,
bs.File_NBR,
s.Skill
bs.score
FROM [New_EEs].[dbo].[SBC_Best_Scores] bs
inner join new_ees.dbo.SBC_Skills s
on bs.Skill_NBR=s.SKILL_NBR
inner join gw_PPP.dbo.Org_Hierarchy oon
bs.File_NBR=o.File_NBR;


VP AVP Director Supervisor Worker File_NBR Skill SCORE
Gerald Kris Doris NULL Mack 107812 B2 4
Gerald Kris Doris NULL Mack 107812 D1 3
Gerald Kris Doris NULL Mack 107812 D2 3
Gerald Kris Doris NULL Mack 107812 D3 3
Gerald Kris Doris NULL Mack 107812 E1 4
Gerald Kris Mike NULL Brady 109080 A1 5
Gerald Kris Mike NULL Brady 109080 B1 4
Gerald Kris Mike NULL Brady 109080 B2 3
Gerald Kris Mike NULL Brady 109080 B3 4
Gerald Kris Mike NULL Brady 109080 C1 4
Gerald Kris Mike NULL Brady 109080 C2 4
Gerald Kris Mike NULL Brady 109080 C3 0
Kim Harry NULL Grant Tom 108457 B1 4
Kim Harry NULL Grant Tom 108457 B2 4
Kim Harry NULL Grant Tom 108457 C1 4
Kim Harry NULL Grant Tom 108457 C2: 5
Kim Harry NULL Grant Tom 108457 C5 5
Kim Harry NULL Grant Tom 108457 D1 4
Kim Harry NULL Grant Tom 108457 D2 5
Kim Harry NULL Grant Tom 108457 D3 4
Kim Harry NULL Grant Jean 106934 C5 4
Kim Harry NULL Grant Jean 106934 D1 5
Kim Harry NULL Grant Jean 106934 D3 5
Kim Harry NULL Grant Raphe 108901 B2 5
Kim Harry NULL Grant Raphe 108901 C2 5
Kim Harry NULL Grant Raphe 108901 C3 4
Kim Harry NULL Grant Raphe 108901 C5 5
Kim Harry NULL Grant Raphe 108901 D2 5
Kim Harry NULL Grant Raphe 108901 E1 5
Kim Harry NULL Grant Tyika 107923 B1 5
Kim Harry NULL Grant Tyika 107923 B2 5
Kim Harry NULL Grant Tyika 107923 D2 4
Kim Harry NULL Grant Tyika 107923 D3 4

The rating levels are 1 through 5. What I need to do is to do is create a table that shows the count and percentage of each rating giving to the workers for each skill grouped by Vp, AVP, Supervisor and Director. So all the works that are Ultimately under a AVP and all the wokers that are Ultimately under a director and so on.

Name Role Skill Count of % of Count of % of
Rating 1 Rating 1 Rating 2 Rating 2
Gerald VP A1 100 29% 130 33%
Gerald VP B1 95 28% 95 24%
Gerald VP B2 120 35% 70 18%
Gerald VP B3 30 9% 100 25%
Kim VP A1
Kim VP B1
Kim VP B2 AND SO ON
Kim VP B3
Kris AVP A1
Kris AVP B1
Kris AVP B2
Kris AVP B3
Harry AVP A1
Harry AVP B1
Harry AVP B2
Harry AVP B3
Doris Director A1
Doris Director B1
Doris Director B2
Doris Director B3
Mike Director A1
Mike Director B1
Mike Director B2
Mike Director B3
Grant Supervisor A1
Grant Supervisor B1
Grant Supervisor B2
Grant Supervisor B3


I am new to SQL server and I'm have trouble figireing this out. Any help would be great, thanks!

MuMu88
Aged Yak Warrior

549 Posts

Posted - 2013-07-21 : 19:36:24
Could you provide the kind of information described on this blog:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Go to Top of Page
   

- Advertisement -