Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / February 2008

Tip: Looking for answers? Try searching our database.

Ranking Query For Multiple Groups using percentages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JB - 01 Feb 2008 19:30 GMT
I have an access query where I have to import data into an excel sheet
to sort and group information by it's velocity code and percentage.
This is starting to take up majority of my day sometimes. I would like
to have a function where it would rank percetages by the velocity code
from lowest to highest values.

The velocity code has seven differeent code values:
$ -- Highest velocity code
A
B
C
D
E
F
G
H
U
N
R - lowest velocity code.

In my query, I find the percentage of fill-rate for each "part" by
divding what was shipped against ordered.

Example of my data:

Part Velocity Ordered Shipped Fill-Rate
DW1234 $ 100 80 .80
DW2134 $ 100 90 .90
DW5668 A 100 75 .75
DW9876 A 100 50 .50

I when a function that would be able to rank by velocity code with
percentages like so:

Part Velocity Ordered Shipped Fill-Rate Rank
DW1234 $ 100 80 .80 1
DW2134 $ 100 90 .90 2
DW5668 A 100 75 .75 1
DW9876 A 100 50 .50 2

Could someone please help me out? This will save me a lot of time and
let me create reports in access instead of having to always import the
data into excel and create a report each and every time when the data
is different.

Thanks

Jeremiah
KARL DEWEY - 02 Feb 2008 00:39 GMT
Create a table Velocity_Rank with field Rank like this ---
Velocity    Rank
$    1
A    2
B    3
C    4
D    5
E    6
F    7
G    8
H    9
U    10
N    11
R    12
Then use two queries ----
  JB_1 ---
SELECT JB.Part, JB.Velocity, JB.Ordered, JB.Shipped, JB.[Fill-Rate],
Velocity_Rank.Rank
FROM JB INNER JOIN Velocity_Rank ON JB.Velocity = Velocity_Rank.Velocity;

SELECT Q.Part, Q.Velocity, Q.Ordered, Q.Shipped, Q.[Fill-Rate], (SELECT
COUNT(*) FROM JB_1 Q1
     WHERE Q1.[Rank] = Q.[Rank]  
       AND Q1.[Fill-Rate] <= Q.[Fill-Rate]) AS Per_Rank
FROM JB_1 AS Q
ORDER BY Q.Rank, Q.[Fill-Rate];

Signature

KARL DEWEY
Build a little - Test a little

> I have an access query where I have to import data into an excel sheet
> to sort and group information by it's velocity code and percentage.
[quoted text clipped - 44 lines]
>
> Jeremiah
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.