Juliana
07/01/2019, 5:10 AMzvictor
07/17/2019, 9:15 PMCASE
, which is a native expression from SQL
used to handle conditional logic at the level of the column expression (i.e., field).zvictor
07/17/2019, 9:15 PMCASE WHEN {type} IN ('Sales Order', 'Invoice') THEN {foreigntotal} ELSE 0 END
zvictor
07/17/2019, 9:17 PMCASE
WHEN {name} = 'Joe' THEN 'Hey, dude!'
WHEN {name} = 'Jane' THEN 'Hey, lady!
WHEN {name} = 'Mike' THEN 'Ssssssup, Mike.'
ELSE 'Who the heck are you?'
END
zvictor
07/17/2019, 9:21 PMELSE
. Otherwise, if there is no logical match, the expression will return NULL
. As you know, in arithmetic or comparison, if any value is NULL
the result is NULL
. So, if you use CASE
inside of a SUM
, for example, and the result is NULL
, check and make sure that there is an ELSE
clause.