Introduction
The decision base defines the data set of your predictive model. Using Calculated Fields you can enrich your data set and add additional parameters for the predictive model, for example calculating the number of days that have past since the user's last activity (based on last activity date).
Supported Functions
The following functions are supported:
Function Name | Description | Example |
abs | Calculates the absolute value for a field and a power | abs(@Field) - > "2" given Field=-2 |
and | Applies the logical and operator Allows multiple logical statements | and(@Field==2, @Field2==3,@Field3==5) - > true |
cast_number | Cast column into a number | cast_number(@Field Name) - > 123 |
concat | Concatenates string | concat(@First Name,".",@Last Name,"/",@Country) - > "John.Doe/US" |
contains | Checks whether a string contains a regex | contains("This is an example","an") - > true |
exists | If the field is not null and not empty, return true | exists(@Field) - > false given Field==null exists(@Field) - > true given Field==123 |
extract_regex | Extracts a capturing group regex from a string | extract_regex("www.example.com?utm_source=google","utm_source=([^&]*)") - > "google" |
ifnull | If the field is null, return the value | ifnull(@Field,2) - > 2 given Field==null |
ifs | Allows to apply conditional statements and return a value when the statement is true. If all statements are false returns the last argument | ifs(3>4,"a",4>5,"b","c") - > c |
lower | Converts string to lower case | lower("ABC") - > "abc" |
not | Applies the logical not operator | not(1>2) - > true not(10>5) - > false |
now | Date time field representing when the data was synced | now() - @Created Date |
or | Applies the logical or operator Allows multiple logical statements | or(@Field==2, @Field2==3,@Field3==5) - > true |
pow | Calculates the exponent for a field and a power | pow(@Field,2") - > "4" given Field=2 |
replace | Replaces a regex within a string | |
split_prefix | Splits a string using the provided separator and leaves only the first element | split_prefix(@Full Name," ") - > "John" |
split_suffix | Splits a string using the provided separator and leaves only the last element | split_suffix(@Full Name," ") - > "Doe" |
text_join | Joins texts using the provided separator | text_join(" ",@First Name,@Last Name,@Country) -> "John Doe US" |
trim | Trims string | trim(" abc ") - > "abc" |
upper | Converts string to upper case | upper("abc") - > "ABC" |
Creating a New Calculated Field
Go to the 'Base' tab and select the decision base you would like to edit.
Find the field you would like to use as a baseline for the calculation and click on the arrow button -> calculated field
Name the new calculated field
Define the logic for the calculated field and click on done
The new field is now pending your approval
You can add additional calculated fields, when you are ready click on the submit button. This will trigger the calculation process, this will take a few minutes.
During the calculation process the base will be unavailable
Note that existing calculated fields can't be edited
You can delete an existing calculated field by clicking on the arrow button -> delete