ifnull
0
0
Edited Sep 1, 2015
Usage 1:
[vector]
x
←
ifnull(
[vector]expr,
[scalar]replacement
)
Returns vector x where x
i equals expr
i if expr
i is not
null. If
expr
i is
null then x
i is set to replacement.
This is commonly used to re-base a measure to all respondents by converting missing values (
nulls) to 0.
Examples:
ifnull(Q3r1,0)pctin(ifnull(Q3r1,0),1)Usage 2:[scalar]y
←
ifnull(
[scalar]x,
[scalar]replacement
)
Returns replacement if x is
null, otherwise returns x.