× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



We have trucks that we want to rank in different categories and display
these multiple rankings at the same time. For example, the categories
are Revenue, Miles, Revenue per Mile, etc. Revenue per Mile(RPM) is
calculated based on Revenue and Miles. We plan on keeping these numbers
with a record for each month for viewing history. We plan on being able
to display a units history (several months at a time) and show their
rankings within each month. For example Truck 1234 in Jan 2012 was
ranked 7th in revenue, 4th in miles, and 12th in RPM - In Feb it was
ranked 2nd, 9th, and 1st respectively.



Revenue
Miles RPM

Jan 2012 7 4
12

Feb 2012 2 9
1



The current approach is that this history file has fields in it for the
actual data as well as each ranking - every time the file is updated
then the rankings are determined for each category by reading the file
in a different sequence and updating the ranking field.



My question - Anyone have a better approach as to how to get these
rankings perhaps on the fly when the data is displayed. I was thinking
about using an array(s) of data structures and just resorting for each
ranking for each month. This approach should work but it does mean
reading the data from all the trucks for each month displayed to do the
ranking. I use SQL but aren't real experienced with it so I don't know
if there is a way for it to do the ranking within a month but only
return the data for the unit to be displayed.



Maybe the original method of updating and storing the ranking in each
record of the file is best but it always bothers me to store calculated
values in a file.


Thanks,



Scott Mildenberger

Programmer/Analyst

Davis Transport Inc.

Missoula, MT

406-728-5510 x128




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.