﻿ Conditional Functions

# Conditional Functions

Conditional functions evaluate a given condition, or set of conditions, and determine if the specified parameters meet the conditions and return a Boolean response of TRUE or FALSE. These functions work with all data types unless otherwise noted.

Within EQuIS Collect, the functions perform calculations as data are entered in forms on the Mobile app. Within EQuIS Link, the functions provide a means to transform data when loading to a selected format.

Below is a descriptive list of each function and its operations. The examples are applicable to either fields in a Collect form or an EQuIS Link data source, unless otherwise noted.

FILTER

The FILTER function evaluates the first parameter and if it renders TRUE, then the function returns the value of the second parameter for the corresponding row. Otherwise, the function returns null.

FILTER(<Parameter_1>,<Parameter_2>)

Aggregate = No

Example 1

FieldA

FieldB

12

EarthSoft

FILTER(EQ([FieldA],12),[FieldB]) = EarthSoft

This formula begins by comparing the parameter values of FieldA with a constant parameter value of “12” and determines if they are equal. In this case, FieldA and the constant parameter value of “12” are equal, and return TRUE, which leads to the formula then returning the FieldB parameter value for the corresponding row, “EarthSoft”.

Example 2

FieldA

FieldB

FieldC

12

Demo

12

FILTER(EQ([FieldA],[FieldC]),[FieldB]) = Demo

This formula begins by comparing the parameter values of FieldA and FieldC and determines if they are equal. In this case, FieldA and FieldC are equal, and return TRUE, which leads to the formula then returning the FieldB parameter value for the corresponding row, “Demo”.

Example 3

FieldA

FieldB

FieldC

12

EarthSoft

9.67

FILTER(EQ([FieldA],[FieldC]),[FieldB]) = NULL

This formula begins by comparing the parameter values of FieldA and FieldC and determines if they are equal. In this case, FieldA and FieldC are not equal, and return FALSE, which leads to the formula then returning NULL.

Example 4

FieldA

FieldB

7

EarthSoft

12

2019

Yes

Demo

FILTER(EQ(FieldA],’Yes’),[FieldB]) = Demo

This formula begins by comparing the parameter values of FieldA with a constant parameter value of “Yes” and determines if they are equal. In this case, FieldA and the constant parameter value of “Yes” are equal, and return TRUE, which leads to the formula then returning the FieldB parameter value for the corresponding row, “Demo”.

IF

The IF function evaluates the first parameter and if it renders TRUE, then the function returns the value of the second parameter. Otherwise, the function returns the third parameter.

IF(<Parameter_1>,<Parameter_2>,<Parameter_3>)

Aggregate = No

Example 1

FieldA

FieldB

FieldC

9.4

9.4

3.7

IF(EQ([FieldA],[FieldB]),’TRUE’,’FALSE’) = TRUE

This formula begins by comparing the parameter values of FieldA and FieldB and determines if they are equal. In this case, FieldA and FieldB are equal, and return TRUE, which corresponds to the formula then returning the constant parameter value of “TRUE”.

Example 2

FieldA

FieldB

FieldC

9.4

9.4

3.7

IF(EQ([FieldA],[FieldC]),’TRUE’,’FALSE’) = FALSE

This formula begins by comparing the parameter values of FieldA and FieldC and determines if they are equal. In this case, FieldA and FieldC are not equal, and return FALSE, which corresponds to the formula then returning the constant parameter value of “FALSE”.

Example 3

FieldA

FieldB

FieldC

FieldD

FieldE

9.4

9.4

3.7

EarthSoft

Demo

IF(EQ([FieldA],[FieldB]),[FieldD],[FieldE]) = EarthSoft

This formula begins by comparing the parameter values of FieldA and FieldB and determines if they are equal. In this case, FieldA and FieldB are equal, and return TRUE, which corresponds to the formula then returning the FieldD value of “EarthSoft”.

Example 4

FieldA

FieldB

FieldC

FieldD

FieldE

9.4

9.4

3.7

EarthSoft

Demo

IF(EQ([FieldA],[FieldC]),[FieldD],[FieldE]) = Demo

This formula begins by comparing the parameter values of FieldA and FieldC and determines if they are equal. In this case, FieldA and FieldC are not equal, and returns FALSE, which corresponds to the formula then returning the FieldE value of “Demo”.

PARAM

The PARAM function gets the first parameter value from a delimited string of the form p1=v1, where the name of the parameter is the second parameter passed. An optional third parameter can be used to specify the character delimiter between parameter value pairs (=). An optional fourth parameter can be used to specify the character between the parameter name and value.

PARAM(<StringParameter_1>,<StringParameter_2>,{<OptionalParameter_1>,<OptionalParameter_2>})

Aggregate = No

Example

FieldA

Lat=42.3149,Lon=83.0364

PARAM([FieldA],'Lon') = 83.0364

This formula is extracting the value associated with “Lon” from the FieldA parameter.

Example 2

FieldA

FieldB

FieldC

A=1,B=2

C=3,E=5,F=6

D=4,E=5,G=7

PARAM([FieldB],’E’) = 5

This formula is extracting the value associated with “E” from the FieldB parameter.