change in count aggregation.xlsx (11.43 KB)
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):
if current month is 4 then:
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.