Overview
Woopra formulas allow you to do row-based calculations in Trend and Profile reports. You can also use formulas to create Custom Event Schema Properties and Custom User Schema Properties.
Trend Reports
In trend reports, you can use formulas to perform any row-based calculations in the Measure By section. If you are looking to transform any dimensions in the Compare By section, you will need to edit these using the Custom Event Schema Properties
Trend Reports
Trend reports are limited to number type operations only.
You can add a formula by clicking to add a column under the Measure By section. Here you'll select to add a formula.
Once you select to add a formula, you can choose which operation you'd like to perform. In the example below, we simply choose to add the People column + 10.
Profile Reports
In Profile Reports, you can use formulas to perform row-based operations using numbers, booleans or strings.
To add a formula, you can click to add a column and select Formulas.
Once you add a formula, you can select which operation you'd like to use. For example, if I wanted to concatenate two columns together, I could use the CAT operations like so:
Operations
These are the various operations you can use when using formulas. Trend Reports are limited to Number type operations only.
OPERATION | DEFINITION | TYPE | PARAMETERS |
---|---|---|---|
ABS | Returns the absolute value of number | Number | number Number |
ADD | Returns the sum of all operand s | Number | operand Object |
AND | Returns true if all condition s are true , otherwise false | Boolean | condition Boolean |
Array_Compact | Returns an array with all empty values removed | Array | array Array |
Array_JOIN | Returns a string with all elements of array joined by delimiter | Text | array Arraydelimiter Text |
Array_Slice | Returns a slice of array from start to end | Array | array Arraystart Number end Number |
ASCII | Returns only ASCII characters string of text . | Object | text Text |
AVG | Returns the average of the input s | Number | input Number |
CAST | Casts the value at the position array as type postition | Object | array Object postition Number |
CAT | Concatenates a list of strings | Text | part Object |
CEIL | Rounds number up | Number | number Number |
CHAR_AT | Returns char of text at index index | Number | text Textindex Number |
CHOOSE | Returns first non-empty parameter | Object | parameters Object |
CONTAINS | Returns true if left contains right , otherwise false | Boolean | left Text right Text |
DATASTORE_LOOKUP | Returns the value of return column name in the resource table where if column name is if column value . Returns default value if no match is found | Text | resource table Textcase Object if column name Textif column value Textreturn column name Text default value Text |
DATE_FORMAT | Formats timestamp as a format | Object | timestamp Object format Text |
DATE_PARSE | Converts date timestamp having format format to unix milliseconds | Object | timestamp Objectformat Text |
DEFAULT | Returns return | Object | return Object |
DIVIDE | Returns the division result of divisor / dividend | Number | dividend Numberdivisor Number |
DOUBLE | Casts object to a double | Number | object Object |
EMPTY | Returns true if input text is empty, otherwise false | Boolean | input text Text |
ENDS | Returns true if left ends with right , otherwise false | Boolean | left Textright Text |
EQ | Returns true if number a is equal to number b , otherwise false | Object | number a Numbernumber b Number |
EXACTMATCH | Returns true if left case sensitively matches right , otherwise false | Boolean | left Textright Text |
FIND | Returns the position of find text inside within text . Return -1 if the text is not found | Number | within text Textfind text Textstart index Number |
FLOOR | Rounds number down | Number | number Number |
GT | Returns true if number a is greater than number b , otherwise false | Boolean | number a Numbernumber b Number |
GTE | Returns true if number a is greater or equal to number b , otherwise false | Boolean | number a Numbernumber b Number |
IF_THEN_ELSE | Returns true result if condition is true , otherwise false result | Object | condition Booleantrue result Objectfalse result Object |
INDEX | Returns the value at the position postition in the range or array array | Text | array Objectpostition Number |
INT | Casts object to an integer | Object | - |
IS | Returns true if left matches right , otherwise false | Boolean | left Textright Text |
JSON_QUERY | Takes a source json and extracts characters and tokens from it | Object | object Object token Text |
LONG | Casts object to a long | Number | object Object |
LT | Returns true if number a is less than number b , otherwise false | Boolean | number a Numbernumber b Number |
LTE | Returns true if number a is less than or equal to number b , otherwise false | Boolean | number a Numbernumber b Number |
MATCH | Returns true if left matches right , otherwise false | Boolean | left Textright Text |
MAX | Returns the largest number in a list of numbers | Number | number Number |
MIN | Returns the smallest number in a list of numbers | Number | number Number |
MULTIPLY | Returns the multiplication of the numbers | Number | operand Number |
NEQ | Returns true if number a is not equal to number b , otherwise false | Object | number a Numbernumber b Number |
NORMALIZE_UNIX_TIME | Parses timestamp as a unix timestamp | Object | timestamp Object |
NOT | Reverses the boolean value of input | Boolean | input Boolean |
NOW | Returns the current time | Object | - |
NULL | Returns null | Object | - |
OR | Returns true if any of condition s are true , otherwise false | Boolean | condition Boolean |
POW | Returns the value of number ^ exponent | Number | number Numberexponent Number |
REGEX_GROUP | Finds the subsequence at index of the input sequence input that matches pattern | Text | input Textpattern Textindex Number |
REGEX_MATCH | Returns true if input matches against pattern , otherwise false | Boolean | input Textpattern Text |
REPLACE | Replaces all occurrences of target in input with replacement | Text | input Texttarget Textreplacement Text |
SELECT | Returns first non-null parameter | Object | parameters Object |
SENSITIVE | Marks value as sensitive information (PII) | Text | value Object |
SENSITIVE_EXT | Marks value as sensitive information (PII) | Text | value Object |
SPLIT | Splits text around the character/text delimiter into an array | Array | text Textdelimiter Text |
SQRT | Returns the square root of number | Number | number Number |
STARTS | Returns true if left starts with right , otherwise false | Boolean | left Text right Text |
STRING | Casts object to a string | Text | object Object |
SUBSTRING | Returns a string that is a substring of text . The substring begins with the character at begin index and extends to end index or the end of the string | Text | text Textbegin index Numberend index Number |
SUBTRACT | Returns the subtraction result number a - number b | Number | number a Numbernumber b Number |
SWITCH | Returns case return value if any case match matches test value , otherwise default | Object | test value Textcase Objectcase match Textcase return value Textdefault Object |
SWITCH_REGEX | Returns case return value if any case regex match matches test value , otherwise default | Object | test value Textcase Objectcase regex match Textcase return value Textdefault Object |
TO_LOWER_CASE | Converts text to lowercase | Text | text Text |
TO_UNIX_MS | Converts date timestamp having format format to unix milliseconds | Object | timestamp Objectformat Text |
TO_UPPER_CASE | Converts text to uppercase | Text | text Text |
TRIM | Returns text with surrounding whitespace removed | Object | text Text |
UNIX_TO_ISO_TIMESTAMP | Converts unix timestamp to ISO timestamp format | Text | timestamp Object |
URL_TO_HOST | Extracts the host part of url | Text | url Text |
WHATAMI | Returns the object (user or organization) of the profile | Object | - |
WHOAMI | Returns the PID (profile ID) of the profile | Object | - |
================= | ================= | ====== | ==================== |
Updated 9 months ago