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(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(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(string, binary) | Checks whether the data type of the attribute specified in the string parameter is date. | |
isDatetime(string, binary) | Checks whether the data type of the attribute specified in the string parameter is datetime. | |
isFloat(string, binary) | Checks whether the data type of the attribute specified in the string parameter is continuous. | |
isInteger(string, binary) | Checks whether the data type of the attribute specified in the string parameter is integer. | |
isMonth(string, binary) | Checks whether the data type of the attribute specified in the string parameter is month. | |
isQuarter(string, binary) | Checks whether the data type of the attribute specified in the string parameter is quarter. | |
isTime(string, binary) | Checks whether the data type of the attribute specified in the string parameter is time. | |
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(string, binary) | Checks whether the data type of the attribute specified in the string parameter is week. |
Parameters in bold are mandatory.