The Calculated metrics builder lets you apply statistical and mathematical functions. This article documents alphabetical list of the advanced functions and their definitions.
Access these functions by selecting Show all below Functions list in the Components panel. Scroll down to see the list of Advanced functions.
A table function is one where the output is the same for every row of the table. A row function is one where the output is different for every row of the table.
Where applicable and relevant, a function is annotated with the type of function:
It tells whether to include zeros in the computation. Sometimes zero means nothing, but sometimes it’s important.
For example, if you have a Revenue metric, and then add a Page Views metric to the report, there are suddenly more rows for your revenue, which are all zero. You probably don’t want that additional metric to affect any MEAN, ROW MINIMUM, QUARTILE, and more calculations that you have in the revenue column. In this case, you would check the include-zeros
parameter.
An alternative scenario is that you have two metrics of interest and one has a higher average or minimum because some of the rows are zeros. In that case, you can opt not to check the parameter to include zeros.
AND(logical_test)
Conjunction. Not equal to zero is considered to be true and equals zero is considered to be false. The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
logical_test | Requires at least one parameter, but can take any number of parameters. Any value or expression that can be evaluated to TRUE or FALSE |
APPROXIMATE COUNT DISTINCT(dimension)
Returns the approximated distinct count of dimension items for the selected dimension.
Argument | Description |
---|---|
dimension | The dimension for which you want to calculate the approximated distinct item count |
A common use case for this function is when you want to get an approximate number of customers.
ARC COSINE(metric)
Argument | Description |
---|---|
metric | The cosine of the angle you want from -1 to 1 |
ARC SINE(metric)
Argument | Description |
---|---|
metric | The sine of the angle you want from -1 to 1 |
ARC TANGENT(metric)
Argument | Description |
---|---|
metric | The tangent of the angle you want from -1 to 1 |
CDF-T(metric, number)
Returns the probability that a random variable with student-t distribution with n degrees of freedom have a z-score less than col.
Argument | Description |
---|---|
metric | The metric for which you would like the Cumulative Distribution Function of the student t-distribution |
number | The degrees of freedom for the Cumulative Distribution Function of the student t-distribution |
CDF-T(-∞, n) = 0
CDF-T(∞, n) = 1
CDF-T(3, 5) ? 0.99865
CDF-T(-2, 7) ? 0.0227501
CDF-T(x, ∞) ? cdf_z(x)
CDF-Z(metric, number)
Returns the probability that a random variable with a normal distribution has a z-score less than col.
Argument | Description |
---|---|
metric | The metric for which you would like the Cumulative Distribution Function of the Standard Normal Distribution |
CDF-Z(-∞) = 0
CDF-Z(∞) = 1
CDF-Z(0) = 0.5
CDF-Z(2) ? 0.97725
CDF-Z(-3) ? 0.0013499
CEILING(metric)
Argument | Description |
---|---|
metric | The metric that you want to round |
CONFIDENCE(normalizing-container, success-metric, control, significance-treshold)
Calculate the any-time-valid confidence lower using the WASKR method as described in Time-uniform central limit theory and asymptotic confidence sequences.
Confidence is a probabilistic measure of how much evidence there is that a given variant is the same as the control variant. A higher confidence indicates less evidence for the assumption that control and non-control variant have equal performance.
Argument | Description |
---|---|
normalizing-container | The basis (People, Sessions, or Events) on which a test is run. |
success-metric | The metric or metrics that a user is comparing variants with. |
control | The variant that all other variants in the experiment are being compared with. Enter the name of the control variant dimension item. |
significance-threshold | The threshold in this function is set to a default of 95%. |
CONFIDENCE(normalizing-container, success-metric, control, significance-treshold)
Calculate the any-time-valid confidence upper using the WASKR method as described in Time-uniform central limit theory and asymptotic confidence sequences.
Confidence is a probabilistic measure of how much evidence there is that a given variant is the same as the control variant. A higher confidence indicates less evidence for the assumption that control and non-control variant have equal performance.
Argument | Description |
---|---|
normalizing-container | The basis (People, Sessions, or Events) on which a test is run. |
success-metric | The metric or metrics that a user is comparing variants with. |
control | The variant that all other variants in the experiment are being compared with. Enter the name of the control variant dimension item. |
significance-threshold | The threshold in this function is set to a default of 95%. |
COSINE(metric)
Argument | Description |
---|---|
metric | The angle in radians for which you want the cosine |
CUBE ROOT(metric)
Returns the positive cube root of a number. The cube root of a number is the value of that number raised to the power of 1/3.
Argument | Description |
---|---|
metric | The metric for which you want to calculate the cube root |
CUMULATIVE(number, metric)
Returns the sum of the last n elements of column x. If n > 0, sum the last n elements or x. If n < 0, sum the preceding elements.
Argument | Description |
---|---|
number | The last N number of rows to return the sum for. If N <= 0 use all previous rows. |
metric | The metric for which you would like the Cumulative Sum. |
Date | Revenue | CUMULATIVE(0, Revenue) | CUMULATIVE(2, Revenue) |
---|---|---|---|
May | $500 | $500 | $500 |
June | $200 | $700 | $700 |
July | $400 | $1100 | $600 |
CUMULATIVE AVERAGE(number, metric)
Returns the average of the last n elements of column x. If n > 0, sum the last n elements or x. If n < 0, sum the preceding elements.
Argument | Description |
---|---|
number | The last N number of rows to return the average for. If N <= 0 use all previous rows. |
metric | The metric for which you would like the Cumulative Average. |
This function does not work with rate metrics like revenue per person. The function averages the rates instead of summing revenue over the last N and summing persons over the last N and then dividing them.
Instead, use CUMULATIVE(revenue) CUMULATIVE(person).
EQUAL()
Equal. The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
metric_X | |
metric_Y |
Metric 1 = Metric 2
EXPONENTIAL REGRESSION: CORRELATION COEFFICIENT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to correlate with metric_Y |
metric_Y | A metric that you would like to correlate with metric_X |
include_zeros | Whether or not to include zero values in the calculations |
EXPONENTIAL REGRESSION: PREDICTED Y(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the independent data. |
metric_Y | A metric that you would like to designate as the dependent data. |
include_zeros | Whether or not to include zero values in the calculations |
EXPONENTIAL REGRESSION: INTERCEPT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
EXPONENTIAL REGRESSION: SLOPE(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
FLOOR(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric | The metric that you want to round. |
GREATER THAN()
The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
metric_X | |
metric_Y |
Metric 1 > Metric 2
GREATER THAN OR EQUAL()
Greater than or equal. The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
metric_X | |
metric_Y |
Metric 1 >= Metric 2
HYPERBOLIC COSINE(metric)
Argument | Description |
---|---|
metric | The angle in radians for which you want to find the hyperbolic cosine |
HYPERBOLIC SINE(metric)
Argument | Description |
---|---|
metric | The angle in radians for which you want to find the hyperbolic sine |
HYPERBOLIC TANGENT(metric)
Argument | Description |
---|---|
metric | The angle in radians for which you want to find the hyperbolic tangent |
IF(logical_test, value_if_true, value_if_false)
Argument | Description |
---|---|
logical_test | Required. Any value or expression that can be evaluated to TRUE or FALSE |
value_if_true | The value that you want to be returned if the logical_test argument evaluates to TRUE. (This argument defaults to 0 if not included.) |
value_if_false | The value that you want to be returned if the logical_test argument evaluates to FALSE. (This argument defaults to 0 if not included.) |
LESS THAN()
The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
metric_X | |
metric_Y |
Metric 1 < Metric 2
LESS THAN OR EQUAL()
Less than or equal. The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
metric_X | |
metric_Y |
Metric 1 <= Metric 2
LINEAR REGRESSION: CORRELATION COEFFICIENT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to correlate with metric_Y |
metric_Y | A metric that you would like to correlate with metric_X |
include_zeros | Whether or not to include zero values in the calculations |
LINEAR REGRESSION: INTERCEPT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
LINEAR REGRESSION: PREDICTED Y(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
LINEAR REGRESSION: SLOPE(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
LOG BASE 10(metric)
Argument | Description |
---|---|
metric | The positive real number for which you want the base-10 logarithm |
LOG REGRESSION: CORRELATION COEFFICIENT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to correlate with metric_Y |
metric_Y | A metric that you would like to correlate with metric_X |
include_zeros | Whether or not to include zero values in the calculations |
LOG REGRESSION: INTERCEPT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
LOG REGRESSION: PREDICTED Y(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
LOG REGRESSION: SLOPE(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
NATURAL LOG(metric)
Returns the natural logarithm of a number. Natural logarithms are based on the constant e (2.71828182845904). LN is the inverse of the EXP function.
Argument | Description |
---|---|
metric | The positive real number for which you want the natural logarithm |
NOT(logical)
Negation as a boolean. The output is either 0 (false) or 1 (true).
Argument | Description |
---|---|
logical | Required. A value or expression that can be evaluated to TRUE or FALSE |
NOT EQUAL()
Not Equal. The output is either a 0 (false) or 1 (true).
Argument | Description |
---|---|
metric_X | |
metric_Y |
Metric 1 != Metric 2
OR(logical_test)
Argument | Description |
---|---|
logical_test | Requires at least one parameter but can take any number of parameters. Any value or expression that can be evaluated to TRUE or FALSE |
0 (zero) means False, and any other value is True.
PI()
Returns Pi: 3.14159…
POWER REGRESSION: CORRELATION COEFFICIENT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to correlate with metric_Y |
metric_Y | A metric that you would like to correlate with metric_X |
include_zeros | Whether or not to include zero values in the calculations |
POWER REGRESSION: INTERCEPT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
POWER REGRESSION: PREDICTED Y(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
POWER REGRESSION: SLOPE(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
QUADRATIC REGRESSION: CORRELATION COEFFICIENT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to correlate with metric_Y |
metric_Y | A metric that you would like to correlate with metric_X |
include_zeros | Whether or not to include zero values in the calculations |
QUADRATIC REGRESSION: INTERCEPT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
QUADRATIC REGRESSION: PREDICTED Y(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
QUADRATIC REGRESSION: SLOPE(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
RECIPROCAL REGRESSION: CORRELATION COEFFICIENT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to correlate with metric_Y |
metric_Y | A metric that you would like to correlate with metric_X |
include_zeros | Whether or not to include zero values in the calculations |
RECIPROCAL REGRESSION: INTERCEPT(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
RECIPROCAL REGRESSION: PREDICTED Y(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
RECIPROCAL REGRESSION: SLOPE(metric_X, metric_Y, include_zeros)
Argument | Description |
---|---|
metric_X | A metric that you would like to designate as the dependent data |
metric_Y | A metric that you would like to designate as the independent data |
include_zeros | Whether or not to include zero values in the calculations |
SINE(metric)
Argument | Description |
---|---|
metric | The angle in radians for which you want the sine |
T-SCORE(metric, include_zeros)
The deviation from the MEAN, divided by the standard deviation. Alias for Z-Score.
Argument | Description |
---|---|
metric | The metric for which you would like the T Score |
include_zeros | Whether or not to include zero values in the calculations |
T-TEST(metric, degrees, tails)
Performs an m-tailed t-test with t-score of x and n degrees of freedom.
Argument | Description |
---|---|
metric | The metric on which you would like to perform a T Test |
degrees | The degrees of freedom |
tails | The length of the tail to be used to perform the T Test |
The signature is T-TEST(metric, degrees, tails). Underneath, it simply calls m CDF-T(-ABSOLUTE VALUE(tails), degrees). This function is similar to the Z-TEST function, which runs m CDF-Z(-ABSOLUTE VALUE(tails)).
The return value is the probability of seeing the test statistic x given the degrees of freedom and number of tails.
Examples:
Use the function to find outliers:
T-TEST(Z-SCORE(bouncerate), ROW COUNT - 1, 2)
Combine the function with IF to ignore very high or low bounce rates, and count sessions on everything else:
IF(T-TEST(Z-SCORE(bouncerate), ROW COUNT - 1, 2) < 0.01, 0, sessions )
TANGENT(metric)
Returns the tangent of the given angle. If the angle is in degrees, multiply the angle by PI( )/180.
Argument | Description |
---|---|
metric | The angle in radians for which you want the tangent |
Z-SCORE(metric, include_zeros)
Argument | Description |
---|---|
metric | The metric for which you would like the Z Score |
include_zeros | Whether or not to include zero values in the calculations |
A Z-score of 0 (zero) implies the score is the same as the mean. A Z-score can be positive or negative, indicating whether it is above or below the mean and by how many standard deviations.
The equation for Z-score is:
Where x is the raw score, μ is the mean of the population, and σ is the standard deviation of the population.
μ (mu) and σ (sigma) are automatically calculated from the metric.
Z-TEST(metric_tails)
Performs an n-tailed z-test with a z-score of x.
Argument | Description |
---|---|
metric | The metric on which you would like to perform a Z Test |
tails | The length of the tail to be used to perform the Z Test |
Assumes that the values are normally distributed.