Search code examples
netsuitesaved-searchessuiteql

CASE statement with a formula as the True or False


Hey I'm trying to create a Formula(Numeric) result on a saved search within Netsuite. I want the case to be true when the transaction type is 'creditmemo', and false otherwise. If true, I want to multiply the value by a -1. Is this possible? I've found examples of CASE statements, and I can do the normal numeric formula where you perform an operation on the result always, but I'm struggling to combine the 2. Are there any good comprehensive guides online I've missed? Thanks!


Solution

  • Use it like:

    CASE {type} WHEN 'Credit Memo' THEN -1*{amount} ELSE {amount} END
    

    or simply:

    CASE {type} WHEN 'Credit Memo' THEN -{amount} ELSE {amount} END