botserver/templates/_drafts/bi.gbai/bi.gbai/bi-user.bas
2024-09-09 17:54:25 -03:00

11 lines
472 B
QBasic

REM Monthly consumption of bars (Individual sending to each customer)
customers = FIND "Customers"
FOR EACH c IN customers
data = SELECT SUM(UnitPrice * Quantity) as Value, MONTH(OrderDate)+'/'+YEAR(OrderDate) from billing
JOIN Customers ON billing.CustomerID = Customers.CustomerID
GROUP BY MONTH(OrderDate), YEAR(OrderDate)
WHERE Customers.CustomerID = c.CustomerID
img = CHART "timseries", data
SEND FILE img, "Monthly Consumption"
END FOR