CASE WHEN {currency} is CAD THEN {customer.balance...
# suiteanalytics
a
CASE WHEN {currency} is CAD THEN {customer.balance} ELSE {{customer.balance}}/{exchangerate} END can this sort of a statement be used??
s
Never tried but
CAD
should likely be in
''
or `""`; you also might want to NVL on
exchangerate
, the double bracket on `customer.balance`feels like a typo as well
a
@Sandii thanks - yeah the typo was fixed and tried to add "" '' and brackets but still keep getting invalid expression. curious on how to use NVL here
g
Maybe something more like this:
CASE
WHEN {currency} = 'CAD'
THEN {customer.balance}
ELSE {customer.balance}/NULLIF({exchangerate}, 0)
END
NULLIF may help a possible divide by 0 for
{exchangerate}
Also, perhaps try the
=
instead of
IS
a
@George McMullen thank you sir. that worked beautifully
👍 1