If a is not undefined, then return b, else return undefined.
If a is not undefined, then return b, else return c.
Syntax
IFNOTUNDEF(a, b)
IFNOTUNDEF(a, b, c)
Input
a | is the test condition: a boolean expression containing at least one map name or one column name. |
b, c | an expression containing at least one map name or one column name, or simply a value, class name, ID, etc. |
Output
IFNOTUNDEF returns: | if a is not undefined, b is returned; if a is undefined and c is specified then c is returned; if a is undefined and c is not specified, undefined is returned. |
Domain: |
the class/ID domain returned by c;
|
Notes:
Tip:
When the definition symbol = is used, a dependent output map or dependent output column is created; when the assignment symbol := is used, the dependency link is immediately broken after the output map/column has been calculated.
Usable in
Examples
MapCalc example using a value map:
OutMap1 = IFNOTUNDEF(InMap,100)
OutMap2 = IFNOTUNDEF(InMap,10,50)
InMap |
OutMap1 |
OutMap2 |
|||||||||||||||||||||||||||
|
|
|
MapCalc example using a class map:
OutMap1 = IFNOTUNDEF(Landuse,"Suitable")
OutMap2 = IFNOTUNDEF(Landuse,"Suitable","Not Suitable")
Landuse |
OutMap1 |
OutMap2 |
|||||||||||||||||||||||||||
|
|
|
Note:
In map Landuse: F=Forest, G=Grassland and L=Lake.
TabCalc examples:
OutCol1 = IFNOTUNDEF(Population,1000)
OutCol2 = IFNOTUNDEF(Population,1000,5000)
OutCol3 = IFNOTUNDEF(Landuse,"Suitable")
OutCol4 = IFNOTUNDEF(Landuse,"Suitable","Not Suitable")
Sitenr |
Population |
Landuse |
OutCol1 |
OutCol2 |
OutCol3 |
OutCol4 |
1 |
850 |
Crops |
1000 |
1000 |
Suitable |
Suitable |
2 |
? |
Grassland |
? |
5000 |
Suitable |
Suitable |
3 |
600 |
Urban area |
1000 |
1000 |
Suitable |
Suitable |
4 |
950 |
? |
1000 |
1000 |
? |
Not Suitable |
5 |
1250 |
Crops |
1000 |
1000 |
Suitable |
Suitable |
6 |
450 |
? |
1000 |
1000 |
? |
Not Suitable |
7 |
? |
Grassland |
? |
5000 |
Suitable |
Suitable |
8 |
900 |
Urban area |
1000 |
1000 |
Suitable |
Suitable |
See also:
ISUNDEF |
IFUNDEF |
IFF |
Map and Table Calculation : Assigning undefined values |
How to calculate with undefineds in maps and tables |
Map and Table Calculation : Merging domains (workaround) |