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.

1265

You can perform any row based operations and even combine multiple operations when using Formulas.

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 operands

Number

operand Object

AND

Returns true if all conditions 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 Array
delimiter Text

Array_Slice

Returns a slice of array from start to end

Array

array Array
start Number
end Number

ASCII

Returns only ASCII characters string of text.

Object

text Text

AVG

Returns the average of the inputs

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 Text
index 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 Text
case Object
if column name Text
if column value Text
return 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 Object
format Text

DEFAULT

Returns return

Object

return Object

DIVIDE

Returns the division result of divisor / dividend

Number

dividend Number
divisor 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 Text
right Text

EQ

Returns true if number a is equal to number b, otherwise false

Object

number a Number
number b Number

EXACTMATCH

Returns true if left case sensitively matches right, otherwise false

Boolean

left Text
right Text

FIND

Returns the position of find text inside within text. Return -1 if the text is not found

Number

within text Text
find text Text
start 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 Number
number b Number

GTE

Returns true if number a is greater or equal to number b, otherwise false

Boolean

number a Number
number b Number

IF_THEN_ELSE

Returns true result if condition is true, otherwise false result

Object

condition Boolean
true result Object
false result Object

INDEX

Returns the value at the position postition in the range or array array

Text

array Object
postition Number

INT

Casts object to an integer

Object

IS

Returns true if left matches right, otherwise false

Boolean

left Text
right 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 Number
number b Number

LTE

Returns true if number a is less than or equal to number b, otherwise false

Boolean

number a Number
number b Number

MATCH

Returns true if left matches right, otherwise false

Boolean

left Text
right 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 Number
number 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 conditions are true, otherwise false

Boolean

condition Boolean

POW

Returns the value of number ^ exponent

Number

number Number
exponent Number

REGEX_GROUP

Finds the subsequence at index of the input sequence input that matches pattern

Text

input Text
pattern Text
index Number

REGEX_MATCH

Returns true if input matches against pattern, otherwise false

Boolean

input Text
pattern Text

REPLACE

Replaces all occurrences of target in input with replacement

Text

input Text
target Text
replacement 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 Text
delimiter 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 Text

begin index Number

end index Number

SUBTRACT

Returns the subtraction result number a - number b

Number

number a Number
number b Number

SWITCH

Returns case return value if any case match matches test value, otherwise default

Object

test value Text
case Object
case match Text
case return value Text
default Object

SWITCH_REGEX

Returns case return value if any case regex match matches test value, otherwise default

Object

test value Text
case Object
case regex match Text
case return value Text
default 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 Object
format 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

=================

=================

======

====================