Is null: isnull
Syntax
isnull ( op )
Input parameters
op |
the operand |
Examples of valid syntaxes
isnull(DS_1)
Semantics for scalar operations
The operator returns TRUE if the value of the operand is NULL, FALSE otherwise. For example:
isnull(“Hello”)
gives FALSE
isnull(NULL)
gives TRUE
Input parameters type
op
dataset {measure<scalar> _}
| component<scalar>
| scalar
Result type
result
dataset { measure<boolean> bool_var }
| component<boolean>
| boolean
Additional Constraints
If op is a Data Set then it has exactly one measure.
Behaviour
The operator has the typical behaviour of the “Operators changing the data type” (see the section “Typical behaviours of the ML Operators”).
Examples
Given the operand dataset DS_1:
Input DS_1 (see structure)
Id_1 |
Id_2 |
Id_3 |
Id_4 |
Me_1 |
---|---|---|---|---|
2012 |
B |
Total |
Total |
11094850 |
2012 |
G |
Total |
Total |
11123034 |
2012 |
S |
Total |
Total |
|
2012 |
M |
Total |
Total |
46818219 |
2012 |
F |
Total |
Total |
5401267 |
2012 |
W |
Total |
Total |
Example 1
DS_r := isnull(DS_1);
results in (see structure):
Id_1 |
Id_2 |
Id_3 |
Id_4 |
bool_var |
---|---|---|---|---|
2012 |
B |
Total |
Total |
False |
2012 |
G |
Total |
Total |
False |
2012 |
S |
Total |
Total |
True |
2012 |
M |
Total |
Total |
False |
2012 |
F |
Total |
Total |
False |
2012 |
W |
Total |
Total |
True |
Example 2
DS_r := DS_1[ calc Me_2 := isnull(Me_1) ];
results in (see structure):
Id_1 |
Id_2 |
Id_3 |
Id_4 |
Me_1 |
Me_2 |
---|---|---|---|---|---|
2012 |
B |
Total |
Total |
11094850 |
False |
2012 |
G |
Total |
Total |
11123034 |
False |
2012 |
S |
Total |
Total |
True |
|
2012 |
M |
Total |
Total |
46818219 |
False |
2012 |
F |
Total |
Total |
5401267 |
False |
2012 |
W |
Total |
Total |
True |