Perfect! Now let's configure the data source.
In ReportBurster's top menu, go to:
Now configure these settings:
SELECT
c.CustomerID,
c.CompanyName,
c.ContactName,
c.Country,
c.City,
COUNT(DISTINCT o.OrderID) as TotalOrders,
SUM(od.Quantity * od.UnitPrice * (1 - od.Discount)) as TotalRevenue,
SUM(od.Quantity * od.UnitPrice * (1 - od.Discount)) / COUNT(DISTINCT o.OrderID) as AvgOrderValue,
SUM(o.Freight) as TotalFreight,
MIN(o.OrderDate) as FirstOrderDate,
MAX(o.OrderDate) as LastOrderDate
FROM Customers c
LEFT JOIN Orders o ON c.CustomerID = o.CustomerID
LEFT JOIN "Order Details" od ON o.OrderID = od.OrderID
GROUP BY c.CustomerID
ORDER BY TotalRevenue DESC
What the query does: