I have a table with date, customer, quantity and I need to know the variation amount from the previous date
EXAMPLE: CUSTOMER 3 ON 21TH -> 198-148= 50
If you want to calculate this in the script:
If(Previous(Customer) = Customer, Quantity- Previous(Quantity) ) as Diff
ORDER BY Customer, Date;
DROP Table YourTable;
Retrieving data ...