How to calculate

with undefineds in maps and tables

You might wish to:

Testing for undefineds:

To test for undefined values, use the ISUNDEF function. The ISUNDEF function tests whether a is undefined. Argument a can be the outcome of an expression or simply a map or column name. Below, the ISUNDEF function is combined with a conditional IFF.

Result1 = IFF (ISUNDEF(Landuse), "Mountains", Landuse)

Result2 = IFF (ISUNDEF(Population), 1000, Population)

First formula (on a domain Class map or column):

If a pixel in map Landuse is undefined, then class name "Mountains" is assigned to this pixel in map Result1; else the original class name is assigned. Same for fields in column Landuse.

Second formula (on a domain Value map or column):

If a pixel of map Population is undefined, then value 1000 is assigned to this pixel in map Result2; else the original population value is assigned. Same for fields in column Landuse.

 

Tip: You can also use the IFUNDEF function.

Assigning undefined values:

To assign undefined values, use a question mark when the output domain is a domain Value, and use a question mark in between double quotes when the output domain is a domain Class or ID.   

Result3 = IFF(Landuse = "Mountains", "?", Landuse)

Result4 = IFF(Population = 1000, ?, Population)

Third formula (output domain Class or ID):

If a pixel in map Landuse has class name "Mountains", then undefined is assigned to this pixel in map Result3; else the original class name is assigned. Same for fields in column Landuse.

Fourth formula (output domain Value):

If a pixel in map Population has value 1000, then undefined is assigned to this pixel in map Result4; else the original Population value is assigned. Same for fields in column Landuse.

See also: