Sales Data from the Contoso Dataset
Source: R/data.R
This dataset contains information about sales orders, including order details, pricing, and customer data from the Contoso dataset. It provides insights into the transactions that have occurred, including order dates, delivery dates, customer and store information, as well as product details.
Usage
salesDetails
Each row is one line item on one order — the same grain as orderrows. This is the denormalised fact table: it repeats every column of orders and orderrows, adds the day’s exchange_rate, and pre-computes seven revenue, cost and margin measures.
Format
A data frame with 7,794 rows and 20 columns:
- order_key
-
doubleUnique identifier for each order. - line_number
-
doubleLine number within the order (for multi-line orders). - order_date
-
DateDate when the order was placed. - delivery_date
-
DateDate when the order was delivered. - customer_key
-
doubleUnique identifier for the customer who placed the order. - store_key
-
doubleUnique identifier for the store where the order was placed. - product_key
-
doubleUnique identifier for the product in the order. - quantity
-
doubleThe quantity of the product ordered. - unit_price
-
doubleThe price per unit of the product. - net_price
-
doubleThe price per unit after discount, in USD. Despite the name this is a unit figure, not a line total. - unit_cost
-
doubleThe cost per unit of the product. - currency_code
-
characterThe currency the order was placed in (e.g., USD, EUR). Does not describe the money columns, which are all USD. - exchange_rate
-
doubleThe USD-to-currency_coderate onorder_date, from fx. 1.0 for USD orders. It has not been applied to the money columns — multiply if you want local currency. - gross_revenue
-
doubleA product’s unit_price multiplied by quantity. - net_revenue
-
doubleA product’s net_price multiplied by quantity. - unit_discount
-
doubleA product’s unit_price minus net_price. - discounts
-
doubleA product’s unit_discount multiplied by quantity. - cogs
-
doubleCost of goods sold. A product’s unit_cost multiplied by quantity. - gross_margin
-
doubleA product’s net_revenue minus cogs. - unit_margin
-
doubleA product’s gross_margin divided by quantity.
Currency
Every money column is in USD, regardless of the order’s currency_code, so amounts sum directly across orders. Multiply by exchange_rate to express an amount in the currency the order was placed in.
Source
https://github.com/sql-bi/Contoso-Data-Generator-V2-Data/releases/tag/ready-to-use-data