Formulas
Last updated
Last updated
Creates a new column with the ouput of the formula.
You can type any formula in the Formula text area. Available area are shown below.
Takes three arguments, the first one must be a boolean and the second and third must return the same type.
In the expression_if_true
and expression_if_false
part, you can use comparators and mathematical operations such as: +
,-
,/
,*
,>
,<
,=
,>=
,<=
,like
Examples:
Like operator
The like operator is used to compare strings together and can be used to do "begins with", "ends with", "contains".
Begins with "toto": column_a like "toto%"
Ends with "toto": column_a like "%toto"
Contains "toto": column_a like "%toto%"
Takes an url as an input and return the utm source url parameter if exists or null.
Takes an url as an input and return the utm campaign url parameter if exists or null.
Takes an url as an input and return the utm medium url parameter if exists or null.
Takes an url as an input and return the utm term url parameter if exists or null.
Takes an url as an input and return the utm content url parameter if exists or null.
Takes an url as an input and return the domain of the url parameter if exists or null
Takes a column as an input and returns a boolean. Return true if null or false if not null.
Takes a column as an input and returns a boolean. Return true if not null or false if null.
URL(url, label)
Takes two column as an input and returns an html element that can be clicked on
Return the current time.
Takes a number representing the number of milliseconds since the 1st January 1970 as an input and returns the associated date.
Returns the duration between date1 and date2 (date1 - date2), in Day, Month or Week.
resultDateType can be: MILLISECOND
, SECOND
, MINUTE
, HOUR
, DAY
, WEEK
, MONTH
.
Convert a Google Sheet timestamp (number of days since the 31th december 1899) into a proper date.
Returns a cohort when inputed a timestamp. Part can be: DAY
, WEEK
,MONTH
or YEAR.
Returns a cohort when inputed a date. Part can be: DAY
, WEEK
,MONTH
or YEAR.
Timezone will be used to calculate the proper DAY, WEEK, etc. in the Timezone. It should follow the Timezone Database Name format, ex Europe/Paris
Add period to a date. Part can be: SECOND
, MINUTE
, HOUR
, DAY
, WEEK
, MONTH
, QUARTER
, YEAR
Format a date into string. Supported format are described below.
Parse a string that match the format and turn it into a Date. Supported format are described below.
Takes several columns separated by ";
" and returns a concatenated string. Ex:
Extract howMany characters from the beginning of the string.
Extract howMany characters from the end of the string.
Extract a substring of count characters starting at whereToStart.
Count the number of characters in the String.
Split a column content according to a separator and then return the value at the given index in the splitted array.
Return true if expressionA and expressionB are true.
Return true if expressionA or expressionB are true.
Round a number with a precision.
Floor a number, get rid of the decimals.
Convert a text into an integer number.
Unless otherwise noted, DATETIME
functions that use format strings support the following elements:
Format element
Description
Example
%A
The full weekday name.
Wednesday
%a
The abbreviated weekday name.
Wed
%B
The full month name.
January
%b or %h
The abbreviated month name.
Jan
%C
The century (a year divided by 100 and truncated to an integer) as a decimal number (00-99).
20
%c
The date and time representation.
Wed Jan 20 21:47:00 2021
%D
The date in the format %m/%d/%y.
01/20/21
%d
The day of the month as a decimal number (01-31).
20
%e
The day of month as a decimal number (1-31); single digits are preceded by a space.
20
%F
The date in the format %Y-%m-%d.
2021-01-20
%G
2021
%g
21
%H
The hour (24-hour clock) as a decimal number (00-23).
21
%I
The hour (12-hour clock) as a decimal number (01-12).
09
%j
The day of the year as a decimal number (001-366).
020
%k
The hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a space.
21
%l
The hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a space.
9
%M
The minute as a decimal number (00-59).
%m
The month as a decimal number (01-12).
01
%n
A newline character.
%P
Either am or pm.
pm
%p
Either AM or PM.
PM
%Q
The quarter as a decimal number (1-4).
1
%R
The time in the format %H:%M.
21:47
%r
The 12-hour clock time using AM/PM notation.
09:47:00 PM
%S
The second as a decimal number (00-60).
00
%s
The number of seconds since 1970-01-01 00:00:00. Always overrides all other format elements, independent of where %s appears in the string. If multiple %s elements appear, then the last one takes precedence.
1611179220
%T
The time in the format %H:%M:%S.
21:47:00
%t
A tab character.
%U
The week number of the year (Sunday as the first day of the week) as a decimal number (00-53).
03
%u
The weekday (Monday as the first day of the week) as a decimal number (1-7).
3
%V
03
%W
The week number of the year (Monday as the first day of the week) as a decimal number (00-53).
03
%w
The weekday (Sunday as the first day of the week) as a decimal number (0-6).
3
%X
The time representation in HH:MM:SS format.
21:47:00
%x
The date representation in MM/DD/YY format.
01/20/21
%Y
The year with century as a decimal number.
2021
%y
The year without century as a decimal number (00-99), with an optional leading zero. Can be mixed with %C. If %C is not specified, years 00-68 are 2000s, while years 69-99 are 1900s.
21
%%
A single % character.
%
%E<number>S
Seconds with <number> digits of fractional precision.
00.000 for %E3S
%E*S
Seconds with full fractional precision (a literal '*').
00.123456
%E4Y
Four-character years (0001 ... 9999). Note that %Y produces as many characters as it takes to fully render the year.
2021
YYYY
Four-digit year.
YY
MM
Two-digit month (01=January, etc.).
MON
Full or abbreviated month name.
MMMM
Full month name.
DD
Two-digit day of month (01 through 31).
DY
Abbreviated day of week.
HH24
Two digits for hour (00 through 23). You must not specify AM
/ PM
.
HH12
Two digits for hour (01 through 12). You can specify AM
/ PM
.
AM
, PM
Ante meridiem (am) / post meridiem (pm). Use this only with HH12
(not with HH24
).
MI
Two digits for minute (00 through 59).
SS
Two digits for second (00 through 59).
FF[0-9]
Fractional seconds with precision 0 (seconds) to 9 (nanoseconds), e.g. FF
, FF0
, FF3
, FF9
. Specifying FF
is equivalent to FF9
(nanoseconds).
TZH:TZM
, TZHTZM
, TZH
Time zone hour and minute, offset from UTC. Can be prefixed by +
/-
for sign.
The year with century as a decimal number. Each ISO year begins on the Monday before the first Thursday of the Gregorian calendar year. Note that %G and %Y may produce different results near Gregorian year boundaries, where the Gregorian year and ISO year can diverge.
The year without century as a decimal number (00-99). Each ISO year begins on the Monday before the first Thursday of the Gregorian calendar year. Note that %g and %y may produce different results near Gregorian year boundaries, where the Gregorian year and ISO year can diverge.
The week number of the year (Monday as the first day of the week) as a decimal number (01-53). If the week containing January 1 has four or more days in the new year, then it is week 1; otherwise it is week 53 of the previous year, and the next week is week 1.
Two-digit year, controlled by the session parameter, e.g. when set to 1980
, values of 79
and 80
parsed as 2079
and 1980
respectively.