Logical functions in the Factory

Logical functions are based on true or false conditions.

Ifelse tests whether a specific condition is true, while all the remaining logical functions test whether an attribute corresponds to a specified data type, and can be used on nominal values only.

By default, results are produced as Booleans, consequently all the single values whose data type corresponds to the function return TRUE, otherwise FALSE.

However, if the optional binary parameter is set to False, for example isInteger($"Score", False), all the single values whose data type corresponds to the function return 1, otherwise 0.

These functions are useful when you need to change the type of an attribute and you want to identify outliers.

Rulex Platform formula

Function

Formula

Description

ifelse

ifelse(condition, iftrue, iffalse)

Checks whether a specific condition is true, and returns the value of iftrue if the condition is true, otherwise it returns the value of iffalse if the condition is false.

ifNone

ifNone(column, condition, iftrue)

The ifNone function fills the attribute’s None values, which satisfy the specified condition, with the desired value. If the condition is not satisfied, the cell is left empty.

isDate

isDate(string, binary)

Checks whether the data type of the attribute specified in the string parameter is date.

isDatetime

isDatetime(string, binary)

Checks whether the data type of the attribute specified in the string parameter is datetime.

isFloat

isFloat(string, binary)

Checks whether the data type of the attribute specified in the string parameter is continuous.

isInteger

isInteger(string, binary)

Checks whether the data type of the attribute specified in the string parameter is integer.

isMonth

isMonth(string, binary)

Checks whether the data type of the attribute specified in the string parameter is month.

isQuarter

isQuarter(string, binary)

Checks whether the data type of the attribute specified in the string parameter is quarter.

isTime

isTime(string, binary)

Checks whether the data type of the attribute specified in the string parameter is time.

isType

isType(string, type, binary)

Checks whether the data type of the attribute specified in the string parameter corresponds to the data type specified in the type parameter.

isWeek

isWeek(string, binary)

Checks whether the data type of the attribute specified in the string parameter is week.

Parameters in bold are mandatory.