Hi, I want to subtract two fields - Bill amount le...
# suiteanalytics
m
Hi, I want to subtract two fields - Bill amount less Item Receipt. Then use the formula in the Criteria > Summary. I have done the following but no joy. CASE WHEN {applyingtransaction.accounttype} = 'Other Current Asset' AND {applyingtransaction.fxamount} - CASE WHEN {applyingtransaction.accounttype} = 'Other Current Liability' AND {applyingtransaction.fxamount} = 0 THEN 1 ELSE 0 END Do you know why it does not work?
b
you have 2 case statements, one of which is incomplete
m
There's a subtraction sign between the two case statements.
b
has no effect what so ever on your incomplete case statement
m
Your statement doesn't explain what's missing.
b
the syntax for the top expression shows what every case statement needs to begin and end with
and the syntax for the search case expression shows the 4 parts of the search case
one of yours is missing 2 of them
j
Not entirely sure what your formula is trying to do as the minus sign is a little ambiguous. It's probably either
Copy code
CASE WHEN ... - CASE WHEN ... THEN ... ELSE ... END ...
THEN ...
ELSE ...
END
OR
Copy code
CASE WHEN ... THEN ... ELSE ... END
-
CASE WHEN ... THEN ... ELSE ... END
That's what Netsuite expects, anyway. What you have right now is
Copy code
CASE WHEN ...
-
CASE WHEN ... THEN ... ELSE ... END
So your first CASE statement is incomplete (it's missing the THEN and the END.
m
Thanks @battk and @Jon Kears for your inputs. I have two cases as follows: CASE WHEN {applyingtransaction.accounttype} = 'Other Current Asset' THEN {applyingtransaction.fxamount} ELSE - CASE WHEN {applyingtransaction.accounttype} = 'Other Current Liability' THEN ABS({applyingtransaction.fxamount}) END END They work as expected. However I want to use both expressions in Criteria to remove some lines. The objective is if the amount for expression 1 minus expression 2 equals zero, then I don't want to see them, otherwise display. That's the bit I'm struggling to get.
b
you want to think in terms of grouping rows
for example, if rows grouped by internal id have a sum of that formula not equal to 0