Case / Switch
Excel
Excel doesn't support a specific case function but instead use an IF...ELSE statement =~IF!~(‹logical_test1›, ‹when_true1›, ~IF!~(‹logical_test2›, ‹when_true2›, ‹when_false2›))
Tableau
~CASE!~ ‹field› ~WHEN!~ ‹condition1› ~THEN!~ ‹return1› «WHEN condition2 THEN return2 ... » ~ELSE!~ ‹returnN› ~END.~
NB. Each WHEN
tests the actual string provided and compares it to the value of the target field; it does not allow logical tests e.g. WHEN > 10 ...
. For this, use an IF...ELSE statement.
Alteryx
~SWITCH!~(‹field›, ‹default_result›, ‹condition1›, ‹return1›«, condition2, return2, ...»)
OrgVue
‹var expression› = {‹condition1›: ‹return1›«, condition2: return2, ... »}; ‹expression›[‹node.field›]
tSQL
~CASE!~ «(field)» ~WHEN!~ ‹condition1› ~THEN!~ ‹return1› ~ELSE!~ ‹return2› ~END!~
NB. If you omit the «field», the CASE
statement will search all fields.
Python
‹var expression› = {‹condition1›: ‹return1›,« condition2: return2, ...»}; ‹expression›[‹field›]
Last updated
Was this helpful?