user manual
103
Handling Missing Values
The @ functions can be used in conjunction with the @FIELD function to identify th e presen ce
of blank or nul
l values in one or more fields. The fields can simply be flagged when blank
or null values are present, or they can be filled with replacement values or used in a va r iety
of other operatio ns.
You can count nulls across a list of fields, as follows:
count_nulls(['cardtenure' 'card2tenure' 'card3tenure'])
When usin g any of the functions that accept a list of fields as input , the special functions
@FIELDS_BETWEEN and @FIELDS_MATCHING can be use d, as shown in the following ex ample:
count_nulls(@FIELDS_MAT
CHING('card*'))
Figure 6-2
Using a Filler node to replace blank values with 0 in the selected field
You can use the undef functi
on t o fill fields with the system-missing value, displayed as $null$.
For example, to replace any numeric value, you could use a conditional statem ent, such as:
if not(Age > 17) or not(Age < 66) then undef else Age endif
This replaces anything that is not in the range with a system-mis sing value, displayed as $null$. By
using the not() function, you can c atch all other n um eric values, including any negatives. For more
informa tion, see the topic Fun
ctions Handling Blanks and Null Values in Chapter 8 on p. 156.