And since refunds are negative amounts, I updated ...
# suiteanalytics
j
And since refunds are negative amounts, I updated it to this:
SUM(CASE WHEN {type} = 'Credit Memo' OR {type} = 'Cash Refund' THEN 0 - {amount} ELSE 0 END) / SUM(NULLIF(CASE WHEN {type} = 'Cash Sale' OR {type} = 'Invoice' THEN {amount} ELSE 0 END,0))