Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very Complex SQL - My Brain Hurts
Message
From
05/07/2006 12:36:47
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133780
Message ID:
01133901
Views:
19
Hi Sergey

Sorry to confuse you. I'm the hell confused myself. This is an arcane legacy system that I'm just getting to grips with. The ETMDATA table has been compiled from raw ticket machine records (that come in hex format) and sums sales for each class within op within date. Now "that's dealt with in the pre-processing of the raw ETM data that gets compiled into out ETMDATA table" meant that the Op-class table's classes would be checked to ensure that the class was in force on the date of the ticket

i.e. 10 pensioners rode on July 4, each with a class 14/17 ticket - produces 10 ETM hex recs. Our post processing produces 1 ETMDATA rec summing those 10 (then an average is worked out or something - I don't know the processing. UI'm having to ask the clerks who deal with this old system what al this means.

Now the multiplier field has only recently been added to the Op-class table, especially for this report. All new ETM recs since the free tickets will have a multiplier of 1, i.e. their class will have a xplier of 1.0

You can see from the report layout that operator A, class 15: 100 paqssengers, multiplier of 2.5 -> 250 "trips"

:-)

Terry

>Hi Terry.
>
>So far, the prolem was to get info from you not the query itself. On one hand you said that multiplier is "dealt with in the pre-processing of the raw ETM data that gets compiled into out ETMDATA table" on other you are saying that it should be pulled from the Operator-Class table.
>
>>You see the Operator-Class table has op#, class# and multiplier?
>>
>>So when a class is encountereed in the ETMData table, its assoc. multiplier is looked up in the Op-Class table, via the the ETMData's Op# & Class #
>>
>>Told you this was a brain ache! :-)
>>
>>Thank you for your continuing interest, as usual
>>
>>>Where "Multiplier" in your report comes from? I don't see it mentioned as a part of ETMDATA table.
>>>
>>>>>What about "Multiplier"? Does OPERATOR_CLASS table also has date field?
>>>>
>>>>OK, we're after the averag no. of journeys in the ETMDATA (Automated Ticket M/c DATA)say the pensioner bought a return ticket, (a particular class), that class's multiplier might be 2.0, meanimng that ticket is worth 2 trips. An all-day-rover (class) might be used, on average, 2.5 trips.
>>>>
>>>>This only applies to last year's data. Now as they're all zero-rated, all classes have a multiplier of 1.0.
>>>>
>>>>Very astute of you to divine that the Op. Class table has a date. Actually it has a start and end date, specifying when the conc. scheme began and ends. But that isn't important here as that's dealt with in the pre-processing of the raw ETM data that gets compiled into out ETMDATA table that sums up ticket sales for each ticket class within each route.
>>>>
>>>>Confused? I know I am! ;-S
>>>>
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform