I am having trouble joining two data sources for linear regression...
I am trying to combine tire maintenance data with daily production data from the truck on which the tire was found.
In Excel terms, I need to perform SUMIF and COUNTIF from two separate data sources.
My first data source is grouped by the serial number of the tire, then by the truck on which the tire was recorded, I can also see the date range during which the tire was on the truck. It looks like this...
| Serial Number | Truck | Min_Date | Max_Date |
| 07215 | 033 | 2011-10-07 | 2011-12-09 |
| 07215 | 035 | 2012-06-14 | 2012-10-29 |
| 07215 | 036 | 2012-04-22 | 2012-05-02 |
My second data source is production data, where individual activities (dozens per day) are captured and organized by truck. It looks like this...
| Truck | Date | Hours Driven | Operator ID |
033 | 2011-10-17 | .5 | 012 |
| 033 | 2011-10-17 | .52 | 012 |
| 033 | 2012-06-20 | .43 | 011 |
I need to simultaneously join these two files and Sum/Count the corresponding production data according to the recorded maintenance data.