The first question every Shopify merchant asks โ answered cleanly from your orders table with correct paid-order filtering and period-over-period comparison.
This is part of the Taptic Data Shopify query library. Explore related queries: SQL query for Shopify revenue by month, SQL query for Shopify customer lifetime value, SQL query for Shopify refund rate by product, and more.
The question
The SQL Taptic generates
SELECT TO_CHAR(DATE_TRUNC('month', o.created_at), 'YYYY-MM') AS order_month, COUNT(DISTINCT o.id) AS orders, COUNT(DISTINCT o.customer_id) AS unique_customers, ROUND(SUM(o.total_price)::numeric, 2) AS gross_revenue, ROUND(SUM(o.total_price)::numeric / NULLIF(COUNT(DISTINCT o.id), 0), 2) AS avg_order_value, ROUND(SUM(o.total_price - o.total_refunded)::numeric, 2) AS net_revenue FROM shopify_orders o WHERE o.financial_status IN ('paid', 'partially_refunded') AND o.created_at >= NOW() - INTERVAL '12 months' GROUP BY DATE_TRUNC('month', o.created_at) ORDER BY 1 ASC
This query was generated by Taptic Data from plain English against a real Shopify 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. This type of analysis is commonly used in shopify revenue dashboard and multi-channel analytics.
How this query works
What it returns
Monthly table with order count, unique customers, gross revenue, average order value, and net revenue after refunds โ 12 months in chronological order.
Why it matters
All queries and use cases on this page relate to analyzing your Shopify data in Taptic. To see the full analytics workflow, explore shopify revenue dashboard, multi-channel analytics.
FAQ
Generate this automatically
In Taptic Data, you type "Show me monthly Shopify revenue for the last 12 months with ..." and this SQL runs automatically against your real Shopify data.
Try Taptic Free โ $29.99/moNo credit card required. Connect your data source in under 5 minutes.
Related use cases
Compare tools