ifnull

0     0     Edited Sep 1, 2015
Usage 1:
[vector] x ifnull( [vector]expr, [scalar]replacement )

Returns vector x where xi equals expri if expri is not null. If expri is null then xi 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.


Leave a Comment

Please sign in to leave a comment.