J
John R. Baker
I have a complex query that computes a priority score based on importance.
The name of the query is "qryProjectRank". The idea is that projects with
the highest "ProjectScore" should be tackled first. The value of the
"ProjectScore" has already been pre-computed by an earlier linked query, and
is sorted in descending order.
My output looks something like this:
[ProjectName] [ProjectScore]
Project_E 57
Project_H 52
Project_B 51
Project_G 46
Project_C 46
Project_A 32
Project_D 23
Project_F 18
I would like to add another column called "Rank", as shown below. (In this
example, "Project_B" is third on the list, behind "Project_E" and
"Project_H".
[ProjectName] [ProjectScore] [Rank]
Project_E 57 1
Project_H 52 2
Project_B 51 3
Project_G 46 4
Project_C 46 4
Project_A 32 6
Project_D 23 7
Project_F 18 8
Alternately, I would like to add a SECOND ranking, called "Rank2". It is
the same as the first "Rank" except that duplicate "ProjectScore" values do
not get the same "Rank" value. See the following example:
[ProjectName] [ProjectScore] [Rank] [Rank2]
Project_E 57 1 1
Project_H 52 2 2
Project_B 51 3 3
Project_G 46 4 4
Project_C 46 4 5
Project_A 32 6 6
Project_D 23 7 7
Project_F 18 8 8
Can someone help me create a query that will give me the "Rank" and "Rank2"
output I want?
I have studied the example in "Microsoft Knowledge Base Article - 120608" at
the following link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;120608&Product=acc
I am unable to get it to work with this technique.
Thanks!
- John R. Baker
The name of the query is "qryProjectRank". The idea is that projects with
the highest "ProjectScore" should be tackled first. The value of the
"ProjectScore" has already been pre-computed by an earlier linked query, and
is sorted in descending order.
My output looks something like this:
[ProjectName] [ProjectScore]
Project_E 57
Project_H 52
Project_B 51
Project_G 46
Project_C 46
Project_A 32
Project_D 23
Project_F 18
I would like to add another column called "Rank", as shown below. (In this
example, "Project_B" is third on the list, behind "Project_E" and
"Project_H".
[ProjectName] [ProjectScore] [Rank]
Project_E 57 1
Project_H 52 2
Project_B 51 3
Project_G 46 4
Project_C 46 4
Project_A 32 6
Project_D 23 7
Project_F 18 8
Alternately, I would like to add a SECOND ranking, called "Rank2". It is
the same as the first "Rank" except that duplicate "ProjectScore" values do
not get the same "Rank" value. See the following example:
[ProjectName] [ProjectScore] [Rank] [Rank2]
Project_E 57 1 1
Project_H 52 2 2
Project_B 51 3 3
Project_G 46 4 4
Project_C 46 4 5
Project_A 32 6 6
Project_D 23 7 7
Project_F 18 8 8
Can someone help me create a query that will give me the "Rank" and "Rank2"
output I want?
I have studied the example in "Microsoft Knowledge Base Article - 120608" at
the following link:
http://support.microsoft.com/default.aspx?scid=kb;en-us;120608&Product=acc
I am unable to get it to work with this technique.
Thanks!
- John R. Baker