Forum Discussion
cjhoward18
7 years agoEmployee
Hi Aaron,
Try this expression below:
"match(parseFloat($InvoiceTotal)) {
val if val < 0 && $CategoryDescription.trim() == “INVOICE ADJUSTMENTS” => parseFloat($InvoiceAdjustments.trim()),
val if val > 0 && $CategoryDescription.trim() == “INVOICE ADJUSTMENTS” => parseFloat($InvoiceAdjustments.trim()),
val if val < 0 =>
parseFloat($CategorySalesValue.trim()) + parseFloat($CategoryDiscountAllowance.trim())
_ =>
parseFloat($CategorySalesValue.trim()) + parseFloat($CategorySalesTax.trim())
}"
the last case (_) is the default case.
note that val is used to capture your match value.
Also note you could combine branch 1 and 2 since they return the same value and conjoin them with an OR.
aaronb
7 years agoNew Contributor
Thanks Cole. I will give that a try and see what I get.