change in count aggregation.xlsx (11.43 KB)
Hello,
I'm attaching a sample data by year/month/quantity. What I need to show is "Quantity Change". The calculation that need to do is:
"Quantity Change" = sum(quantity) until last month - sum(quantity) until current month
Here is what I need to show if I'm running this query today (current month is 5):
Quantity_Change
8
if current month is 4 then:
Quantity_Change
21
and so on... I've added the expected "Quantity_Change" column with some helpful columns to do the calculation. btw, need to find the current system date now() or current_date to find the previous month.
Any help and support is really appreciated.
Thanks