103
Handling Missing Values
The @functions can be used in conjunction with the @FIELD function to identify the presence
of blank or null values in one or more elds. T he elds can simply be agged when blank
or null values are present, or they can be lled with replacement values or used in a variety
of other operations.
Youcan count nulls acro ss a list of elds, as follows:
count_nulls(['cardtenure''card2tenure' 'card3tenure'])
When using any of the functions that accept a list of elds as input, the special functio ns
@FIELDS_BETWEEN and @FIELDS_MATCHING can be used, as shown in the following example:
count_nulls(@FIELDS_MATCHING('card*'))
Figure 6-2
Using a Filler node to replace blank values with 0 in the selected field
Youcan use the undef function to ll elds wit h the system-missing value, displayed as $null$.
For example, to replace any numeric value, you could use a conditional statement, such as:
ifnot(Age > 17) or not(Age < 66) then undef else Age endif
This replaces anything that is not in the range with a system-missing value, displayed as $nul l$. By
using the not() function, you can catch all other numeric values, including any negatives. For more
information, see the topic Functions Handling Blanks and Null Values in Chapter 8 on p. 156.