Customers By Orders Total

Magento

 

Magento is an open-source e-commerce platform by EBay inc.

Customers By Orders Total (filtered data by year)

Query Text

SELECT 
    SalesOrders_Customers."firstname", SalesOrders_Customers."lastname", COUNT(*) AS "Number of Orders", SUM(SalesOrders."subtotal") 'Total Order Amount'
FROM 
    "SalesOrders"
INNER JOIN 
    "Customers" AS SalesOrders_Customers ON "SalesOrders"."customer_id" = SalesOrders_Customers."customer_id"
WHERE
    strftime('%Y', "SalesOrders"."created_at") = '2015' /*try changing year if you need*/
GROUP BY
    SalesOrders_Customers."firstname", SalesOrders_Customers."lastname"
ORDER BY 4 DESC
  

Open Query