How to Rank

Z

ZIMMJE

Is it possible to rank the following data set and return different rank
values when the cost is the same. Any suggestions would be helpful I can't
fiqure this out in access!:

Item cost Vol Rank
1 10 3 1
2 5 2 2
3 5 1 3
 
M

Marshall Barton

ZIMMJE said:
Is it possible to rank the following data set and return different rank
values when the cost is the same. Any suggestions would be helpful I can't
fiqure this out in access!:

Item cost Vol Rank
1 10 3 1
2 5 2 2
3 5 1 3


You need to use multiple criteria in the ranking subquery:

(X.Cost > tbl.Cost)
OR (X.Cost >= tbl.Cost And X.Vol >= tbl.Vol)
 
Z

ZIMMJE

Could you be more specific? I just can't fiqure out how to get started on
this part of the coding.
 
M

Marshall Barton

SELECT T.item, T.cost, T.Vol,
(SELECT Count(*) FROM table As X
WHERE (X.Cost > tbl.Cost)
OR (X.Cost >= tbl.Cost And X.Vol >= tbl.Vol)
) As Rank
FROM table As T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top