You are on page 1of 1

Definitions for the 7 derived columns (headers shaded green): Extended Sales: Total revenue per line item.

No window functions required. Formula: Quantity * Unit Resale. % Sales For This Order: Shows how much of the total order revenue is accounted for by a given order line. Formula: (Extended Sales for the line) / (Sum of the Extended Sales for the entire order of which the line is a portion). % Sales For This Product: Shows how much of the total revenue for a given Product, regardless of the sales order, is accounted for by a given order line. Formula: (Extended Sales for the particular line) / (sum of the Extended Sales for that product regardless of the sales order). Unit Am % of Simple Avg Unit Am: Shows how the Unit Price on a given line compares to the simple average unit price for that product on all orders. 100% means the unit price for the line equals the simple average unit price for all order lines with that product. Formula: (Unit Resale for the order line) / (Simple average of all Unit Resale prices for that product, regardless of the sales order.) Unit Am % of Wt Avg Unit Am: Shows how the Unit Price on a given line compares to the average unit price for that product on all orders, where the average is weighted by quantity. 100% means the unit price for the line equals the weighted average unit price for all order lines with that product. Formula: (Unit Resale for the order line) / (Weighted average [weighted by quantity] of all unit resale prices for that product, regardless of the sales order.) Ascending Gapless Line Nr: Shows consecutive ascending line numbers for the order lines. Line numbers reset on each new order. Note that the actual line numbers from the table are not always consecutive. For instance, in ORDER_NO 1, the line numbers start with five (one through four are missing) then jump from 7 to 11. For ORDER_NO 3, the line numbers have many gaps. The Gapless column squeezes out the gaps automatically and assigns consecutive line numbers, sorted from lowest to highest. Descending Gapless Line Nr: Shows consecutive descending line numbers for the order lines. Line numbers reset on each new order The only difference between this and the previous column is that the line numbers are sorted from highest to lowest.

You might also like