case when {created} = ADD_MONTHS({today}, -3) and ...
# general
m
case when {created} = ADD_MONTHS({today}, -3) and {transaction.type} = 'Invoice' then {transaction.quantity} else 0 END