Skip to main content
Product-level analytics table for order line revenue, costs, and profitability.
  • Grain: One row per sm_order_line_key, plus one order-level row per order.
  • Order-level row: Every order has one extra row, except orders still pending at the source. Its order_line_id is NULL and its order_line_quantity is 0. It carries order-wide adjustments and any amount that cannot be split across product lines, so line totals still add up to the order total. Filter order_line_id IS NOT NULL when you want product lines only.
  • Date field: order_processed_at_local_datetime.
  • Filters to start with: is_order_sm_valid = TRUE (drops voided, cancelled, uncollectible, draft and refunded orders, and orders cancelled for fraud or a declined payment), and sm_channel for segmentation.
  • Joins: obt_orders via sm_order_key (many:1) and dim_product_variants via sm_product_variant_key (many:1).

When to use this table

Use obt_order_lines for product questions: best sellers, units sold, revenue by SKU, product type, or vendor, and what customers buy together. Each row is one product line on one order, plus one order-level row per order, so summing order_line_net_revenue across a store gives the same total as order_net_revenue in obt_orders. Use obt_orders when the question is about whole orders. Always filter is_order_sm_valid = TRUE unless you deliberately want cancelled or otherwise excluded orders. The flag is also FALSE for orders outside the Online DTC, Amazon, Retail, Wholesale and TikTok Shop sales channels, and for zero-revenue orders when your store excludes them.

Example query

Top products by net revenue over the last 90 days:

More query examples

Columns

When reporting-currency conversion is enabled, standard order-line money fields such as order_line_net_revenue and order_line_total_revenue use the workspace reporting currency. Use the order_line_original_* fields to reconcile against the source. See Reporting Currency.