Operations with active lists and dictionaries
"active_list" and "active_list_dyn" functions
These functions allow you to receive information from an active list and dynamically generate a field name for an active list and key.
You must specify the parameters in the following sequence:
Usage example |
Result |
active_list('Test', to_lower('DeviceHostName'), to_lower(DeviceCustomString2), to_lower(DeviceCustomString1)) |
Gets the field value of the active list. |
Use these functions to query the active list of the shared tenant from a variable. To do so, add the @Shared suffix after the name of the active list (case sensitive). For example, active_list('exampleActiveList@Shared', 'score', SourceAddress, SourceUserName).
"table_dict" function
Gets information about the value in the specified column of a dictionary of the table type.
You must specify the parameters in the following sequence:
Usage example |
Result |
|
Gets data from the |
|
Gets data from the |
Use this function to access the dictionary of the shared tenant from a variable. To do so, add the @Shared
suffix after the name of the active list (case sensitive). For example, table_dict('exampleTableDict@Shared', 'office', SourceUserName)
.
"dict" function
Gets information about the value in the specified column of a dictionary of the dictionary type.
You must specify the parameters in the following sequence:
Usage example |
Result |
|
Gets data from |
|
Gets data from the |
Use this function to access the dictionary of the shared tenant from a variable. To do so, add the @Shared
suffix after the name of the active list (case sensitive). For example, dict('exampleDictionary@Shared', SourceAddress)
.
Operation with rows
"len" function
Returns the number of characters in a string.
A string can be passed as a string, field name or variable.
Usage examples |
|
|
|
"to_lower" function
Converts characters in a string to lowercase.
A string can be passed as a string, field name or variable.
Usage examples |
|
|
|
"to_upper" function
Converts characters in a string to uppercase. A string can be passed as a string, field name or variable.
Usage examples |
|
|
|
"append" function
Adds characters to the end of a string.
You must specify the parameters in the following sequence:
Strings can be passed as a string, field name or variable.
Usage examples |
Usage result |
|
The string |
|
The string |
|
A string from |
"prepend" function
Adds characters to the beginning of a string.
You must specify the parameters in the following sequence:
Strings can be passed as a string, field name or variable.
Usage examples |
Usage result |
|
The string |
|
The string |
|
A string from |
"substring" function
Returns a substring from a string.
You must specify the parameters in the following sequence:
Strings can be passed as a string, field name or variable. If the position number is greater than the original data string length, an empty string is returned.
Usage examples |
Usage result |
|
Returns a part of the string from the |
|
Returns a part of the string from the |
|
Returns the entire string from the |
"tr" function
Deletes the specified characters from the beginning and end of a string.
You must specify the parameters in the following sequence:
Strings can be passed as a string, field name or variable. If you do not specify a string to be deleted, spaces will be removed from the beginning and end of the original string.
Usage examples |
Usage result |
|
Spaces have been removed from the beginning and end of the string from the |
|
If the |
|
If the |
"replace" function
Replaces all occurrences of character sequence A in a string with character sequence B.
You must specify the parameters in the following sequence:
Strings can be passed as an expression.
Usage examples |
Usage result |
|
Returns a string from the |
|
Returns a string from |
"regexp_replace" function
Replaces a sequence of characters that match a regular expression with a sequence of characters and regular expression capturing groups.
You must specify the parameters in the following sequence:
Strings can be passed as a string, field name or variable. Unnamed capturing groups can be used.
In regular expressions used in variable functions, each backslash character must be additionally escaped. For example, ^example\\\\
must be used instead of the regular expression ^example\\
.
Usage examples |
Usage result |
|
Returns a string from the |
"regexp_capture" function
Gets the result matching the regular expression condition from the original string.
You must specify the parameters in the following sequence:
Strings can be passed as a string, field name or variable. Unnamed capturing groups can be used.
In regular expressions used in variable functions, each backslash character must be additionally escaped. For example, ^example\\\\
must be used instead of the regular expression ^example\\
.
Usage examples |
Example values |
Usage result |
|
|
|
Operations with timestamps
now function
Gets a timestamp in epoch format. Runs with no arguments.
Usage examples |
|
"extract_from_timestamp" function
Gets atomic time representations (year, month, day, hour, minute, second, day of the week) from fields and variables with time in the epoch format.
The parameters must be specified in the following sequence:
Possible variants of atomic time notation:
Usage examples |
|
|
|
|
"parse_timestamp" function
Converts the time from RFC3339 format (for example, "2022-05-24 00:00:00", "2022-05-24 00:00:00+0300) to epoch format.
Usage examples |
|
|
"format_timestamp" function
Converts the time from epoch format to RFC3339 format.
The parameters must be specified in the following sequence:
Usage examples |
|
|
|
"truncate_timestamp" function
Rounds the time in epoch format. After rounding, the time is returned in epoch format. Time is rounded down.
The parameters must be specified in the following sequence:
Usage examples |
Examples of rounded values |
Usage result |
|
1654631774175 (7 June 2022, 19:56:14.175) |
1654631760000 (7 June 2022, 19:56:00) |
|
1654631774175 (7 June 2022, 19:56:14.175) |
1654628400000 (7 June 2022, 19:00:00) |
|
1654631774175 (7 June 2022, 19:56:14.175) |
1654560000000 (7 June 2022, 0:00:00) |
"time_diff" function
Gets the time interval between two timestamps in epoch format.
The parameters must be specified in the following sequence:
Usage examples |
|
|
|
Mathematical operations
These are comprised of basic mathematical operations and functions.
Basic mathematical operations
Operations:
Parentheses determine the sequence of actions
Available arguments:
When modulo dividing, only natural numbers can be used as arguments.
Usage constraints:
Usage examples
|
Usage result |
|
4 |
|
-1 |
|
5 |
|
0 |
|
0 |
|
10 |
|
1 |
"round" function
Rounds numbers.
Available arguments:
Usage examples
|
Usage result |
|
8 |
|
8 |
|
7 |
"ceil" function
Rounds up numbers.
Available arguments:
Usage examples
|
Usage result |
|
8 |
|
9 |
"floor" function
Rounds down numbers.
Available arguments:
Usage examples
|
Usage result |
|
7 |
|
8 |
"abs" function
Gets the modulus of a number.
Available arguments:
Usage examples
|
Usage result |
|
7 |
|
2 |
"pow" function
Exponentiates a number.
The parameters must be specified in the following sequence:
Available arguments:
Usage examples |
|
|
"str_join" function
Join multiple strings into one using a separator.
The parameters must be specified in the following sequence:
Usage examples |
Usage result |
|
String. |
"conditional" function
Get one value if a condition is met and another value if the condition is not met.
The parameters must be specified in the following sequence:
Supported operators:
Usage examples (the value depends on arguments 2 and 3) |
|
|
|