This document outlines a calculation package that will calculate totals and averages by product from a database source to a flat file destination. The target SQL code will select product IDs, sum quantities, sum total costs, and average cost from the TransactionHistoryArchive table, grouping by product ID and ordering by product ID. The data flow will calculate line item totals, sum quantities and totals by product, derive average costs, sort by product ID, and output to a flat file destination.