D
doyle60
I wish to create a ranking column on a field in a query basing the
ranking on two other fields. For example, if I have this:
GroupID CatNumber GrpNumber
1455 5.1 1.0
4433 5.1 2.0
8222 5.1 4.2
5446 8.0 2.0
7119 9.3 4.0
2141 9.3 12.0
I would like to rank the results by CatNumber than by GrpNumber,
getting this:
GroupID CatNumber GrpNumber Rank
1455 5.1 1.0 1
4433 5.1 2.0 2
8222 5.1 4.2 3
5446 8.0 2.0 4
7119 9.3 4.0 5
2141 9.3 12.0 6
GroupID is unique.
Searching this group and googling, I cannot find anything exactly like
this. There is a chance that users will misnumber things and create a
tie (I haven't made that impossible for several reasons). In such a
case, I prefer the ranking to simply continue in numeric sequence
without skipping a number or repeating a number, but I will take what I
can get. Thanks in advance,
Matt
ranking on two other fields. For example, if I have this:
GroupID CatNumber GrpNumber
1455 5.1 1.0
4433 5.1 2.0
8222 5.1 4.2
5446 8.0 2.0
7119 9.3 4.0
2141 9.3 12.0
I would like to rank the results by CatNumber than by GrpNumber,
getting this:
GroupID CatNumber GrpNumber Rank
1455 5.1 1.0 1
4433 5.1 2.0 2
8222 5.1 4.2 3
5446 8.0 2.0 4
7119 9.3 4.0 5
2141 9.3 12.0 6
GroupID is unique.
Searching this group and googling, I cannot find anything exactly like
this. There is a chance that users will misnumber things and create a
tie (I haven't made that impossible for several reasons). In such a
case, I prefer the ranking to simply continue in numeric sequence
without skipping a number or repeating a number, but I will take what I
can get. Thanks in advance,
Matt