Conditional Statements in Math Expressions

المشرف العام

Administrator
طاقم الإدارة
Did you know...
You can write Conditional statements (also known as logical, ternary, true/false, or if then else statements) in the Math Expression Builder for database channels, grids, and voxels.
The expression format is 
    New = ( ) ? ( ) : ( )
where the "if" statement is before the question mark, the "then" statement is after the question mark, and the "else" statement is after the colon.

You can also nest these statements.  For example, this statement fills in new values for a channel called NewZ when Depth is less than 0 and when Altm is greater than 1000.
    NewZ = ((Depth 1000) ? DUMMY : Z)
 
You'll find the shortcut in the Frequent tab under Operators and Functions in the Math Expression Builder for each document type:

  1. Databases (Database Tools > Channel Math...)
  2. Grid (Grids and Images > Grid Math...)
  3. Voxels (Voxel > Voxel Math...)

You can also use the Common Tasks to fill in an example True/False statement
Here are some more resources to check out:

 
أعلى