Conditional (FPScript)

21.09.2021

Data analysis. Functional variant of the If...Then...Else statement.

Syntax

Conditional(Condition, If, Else)

 

The syntax of the Conditional function consists of the following parts:

Part

Description

Condition

Results in an expression, TRUE, FALSE, or any numerical scalar value. If the result is numerical, all values not equal to zero are interpreted as TRUE.

Permitted data structures are scalar value. All data types are permitted.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

If

An expression that is evaluated and returned as the result if Condition returns TRUE.

All data structures are allowed. All data types are permitted.

Else

An expression that is evaluated and returned as the result if Condition returns FALSE.

All data structures are allowed. All data types are permitted.

Remarks

The function passes the result of the evaluated expression. The other expression is neither calculated nor returned.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

Conditional(DataType(Signal.X) == TYPE_CALENDARTIME, Signal.X - Signal.TimestampX, Signal.X)

Converts the X component of a signal into relative time as long as this is provided in absolute time.

See Also

If...Then...Else Statement

Share article or send as email:

You might be interested in these articles