Another use of this file is to match it back to the invoice-level file to find the invoice corresponding to the customer's largest purchase during the time covered by this data. Starting with the invoice-level file as the active dataset, the following dialog box shows how to use the customer-level file as a lookup table to get the information associated with the largest invoice:
CustomerID serves as the match key in this one-to-many match. The * and + symbols indicate which file was the source for each of the variables in the resulting file.
The SPSS syntax to perform this match is shown here along with the transformation commands used to identify the largest invoice for each customer:
STAR JOIN
/SELECT t0.InvoiceNo, t0.InvoiceDate, t0.itemcost_total, t0.numproducts, t0.priorinvoicedate,
t0.priorcustID, t0.daysincepurchase...