MartialArtist
Programmer
Being new to PL/SQL, I am having some difficulty in determining how to use PL/SQL to automate a data-cleaning problem. I have written the appropriate SQL to extract recordsets for 21 years of data that contains the year, harvester ID, harvester name, delivery location, total quantity, and total sale price of harvested goods. The data are sorted such that each harvester's data is grouped by year and the records arranged in order of most frequent to least frequent delivery location for the year. My task is to reduce the multiple records within one year to one principal delivery location using the following rules:
If one location has more deliveries than any other that is the principal location. If multiple locations are tied, the one at which the summed sale price which is greatest identifies the principal location.
Can suggest a PL/SQL procedure that I can use to automate the selection of the principal delivery location for each harvester? The alternative is spending 3-5 days per year of data making the selection manually in an Excel spreadsheet.
Thanks in advance for any help you can offer.
If one location has more deliveries than any other that is the principal location. If multiple locations are tied, the one at which the summed sale price which is greatest identifies the principal location.
Can suggest a PL/SQL procedure that I can use to automate the selection of the principal delivery location for each harvester? The alternative is spending 3-5 days per year of data making the selection manually in an Excel spreadsheet.
Thanks in advance for any help you can offer.