The first question every Shopify merchant asks โ answered cleanly from your orders table with correct paid-order filtering and period-over-period comparison.
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.
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
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.