Homeโ€บQuery Libraryโ€บAmazon

How is your Amazon revenue trending month by month?

The most fundamental Amazon business question โ€” answered with clean data from your order_items table, properly excluding cancellations and NULL-priced items.

๐Ÿ“Š Amazon Seller Central๐Ÿ‘ฅ Amazon sellers๐Ÿ”ค Plain-English โ†’ SQL
Show me total Amazon revenue by month for the last 12 months
โ†“
Amazon Revenue by Month โ€” generated by Taptic Data AI
SELECT
  TO_CHAR(DATE_TRUNC('month', o.purchase_date::timestamptz), 'YYYY-MM') AS order_month,
  COUNT(DISTINCT o.amazon_order_id)                                       AS total_orders,
  SUM(i.quantity)                                                         AS units_sold,
  ROUND(SUM(i.item_price * i.quantity), 2)                                AS gross_revenue,
  ROUND(SUM(i.item_price * i.quantity)
    / NULLIF(COUNT(DISTINCT o.amazon_order_id), 0), 2)                  AS avg_order_value
FROM amazon_orders o
JOIN amazon_order_items i
  ON i.amazon_order_id = o.amazon_order_id
WHERE o.order_status NOT IN ('Canceled', 'Cancelled')
  AND i.item_price IS NOT NULL
  AND o.purchase_date::timestamptz >= NOW() - INTERVAL '12 months'
GROUP BY DATE_TRUNC('month', o.purchase_date::timestamptz)
ORDER BY 1 ASC
Schema-aware SQL generated from plain English15 lines

This query was generated by Taptic Data from plain English against a real Amazon Seller Central schema. In Taptic, you type the question โ€” the AI writes the SQL, runs it, and returns the result. You can edit the SQL, ask for explanations, and save it as a refreshable report.

Breaking it down line by line

  1. Casts purchase_date (stored as text in Amazon's SP-API) to timestamptz for proper date math
  2. Truncates to month and formats as YYYY-MM for clean chart axis labels
  3. Filters out Canceled/Cancelled orders (both spellings) and NULL item_price rows
  4. Calculates gross revenue as item_price * quantity per line item, then sums per month
  5. Includes average order value using NULLIF to handle months with zero orders gracefully

Result description

A month-by-month table of orders, units sold, gross revenue, and average order value โ€” covering the last 12 months in chronological order, ready to chart as a line or bar.

The business impact

Monthly revenue trend is the baseline metric for any Amazon business. Seeing it in clean SQL โ€” not Seller Central's limited date filters โ€” lets you spot seasonal patterns, growth inflection points, and the impact of catalog or pricing changes.

Skip the SQL. Ask the question.

In Taptic Data, you type "Show me total Amazon revenue by month for the last 12 months..." and this SQL runs automatically against your real Amazon Seller Central data.

Try Taptic Free โ€” $29.99/mo

No credit card required. Connect your data source in under 5 minutes.