Function list

Looker Studio provides a number of powerful functions that can be used inside of calculated field formulas. 

More information on each function, including examples, is available in the formula editor. This help will appear as you begin to type your formula. Narrow by …Aggregation Arithmetic Conditional Date Geo Miscellaneous Text

Narrow by …

TypeNameDescriptionSyntax
AggregationAVGReturns the average of all values of X.
Learn more.
AVG(X)
AggregationCOUNTReturns the number of values of X.
Learn more.
COUNT(X)
AggregationCOUNT_DISTINCTReturns the number of unique values of X.
Learn more.
COUNT_DISTINCT(X)
AggregationMAXReturns the maximum value of X.
Learn more.
MAX(X)
AggregationMEDIANReturns the median of all values of X.
Learn more.
MEDIAN(X)
AggregationMINReturns the minimum value of X.
Learn more.
MIN(X)
AggregationPERCENTILEReturns the percentile rank N of field X.
Learn more.
PERCENTILE(X,N)
AggregationSTDDEVReturns the standard deviation of X.
Learn more.
STDDEV(X)
AggregationSUMReturns the sum of all values of X.
Learn more.
SUM(X)
AggregationVARIANCEReturns the variance of X.
Learn more.
VARIANCE(X)
ArithmeticABSReturns the absolute value of number.
Learn more.
ABS(X)
ArithmeticACOSReturns the inverse of the cosine of X.
Learn more.
ACOS(X)
ArithmeticASINReturns the inverse of the sine of X.
Learn more.
ASIN(X)
ArithmeticATANReturns the inverse of the tangent of X.
Learn more.
ATAN(X)
ArithmeticCEILReturns the nearest integer greater than X. For example, if the value of X is v, CEIL(X) is greater than or equal to v.
Learn more.
CEIL(X)
ArithmeticCOSReturns the cosine of X.
Learn more.
COS(X)
ArithmeticFLOORReturns the nearest integer less than X. For example, if the value X is v, FLOOR(X) is equal to or less than v.
Learn more.
FLOOR(X)
ArithmeticLOGReturns the logarithm to base 2 of X.
Learn more.
LOG(X)
ArithmeticLOG10Returns the logarithm to base 10 of X.
Learn more.
LOG10(X)
ArithmeticNARY_MAXReturns the maximum value of X, Y, [,Z]*. All input arguments must be of the same type: all numbers. At least one input argument must be a field or an expression containing a field.
Learn more.
NARY_MAX(X, Y [,Z]*)
ArithmeticNARY_MINReturns the minimum value of X, Y, [,Z]*. All input arguments must be of the same type, all numbers. At least one input argument must be a field or an expression containing a field.
Learn more.
NARY_MIN(X, Y [,Z]*)
ArithmeticPOWERReturns result of raising X to the power Y.
Learn more.
POWER(X, Y)
ArithmeticROUNDReturns X rounded to Y precision digits.
Learn more.
ROUND(X, Y)
ArithmeticSINReturns the sine of X.
Learn more.
SIN(X)
ArithmeticSQRTReturns the square root of X. Note that X must be non-negative.
Learn more.
SQRT(X)
ArithmeticTANReturns the tangent of X.
Learn more.
TAN(X)
ConditionalCASEEvaluates the condition of each successive WHEN clause and returns the first result where the condition is true; any remaining WHEN and ELSE clauses are not evaluated. If all conditions are false or NULL, returns else_result if present; if not present, returns NULL. Learn moreCASE WHEN condition THEN result [WHEN condition THEN result] [...] [ELSE else_result] END
ConditionalCASE (Simple)Compares input_expression to expression_to_match of each successive WHEN clause and returns the first result where this comparison returns true. Learn moreCASE input_expression WHEN expression_to_match THEN result [WHEN expression_to_match THEN result] [...] [ELSE result] END
ConditionalIFNULLReturns a result if the input is null, otherwise, returns the input.
Learn more.
IFNULL(input_expression, null_result)
ConditionalCOALESCEReturns the first non-missing value found in a list of fields.
Learn more.
COALESCE(field_expression[,field_expression, ...])
ConditionalIFIf condition is true, returns true_result, else returns false_resultfalse_result is not evaluated if condition is true. true_result is not evaluated if condition is false or NULL. Learn moreIF(condition, true_result, false_result)
ConditionalNULLIFReturns null if the input matches an expression, otherwise returns the input.
Learn more.
NULLIF(input_expression, expression_to_match)
DateCURRENT_DATEReturns the current date as of the specified or default timezone.
Learn more.
CURRENT_DATE([time_zone])
DateCURRENT_DATETIMEReturns the current date and time as of the specified or default timezone.
Learn more.
CURRENT_DATETIME([time_zone])
DateDATEConstructs a Date field or value from numbers or from a Date & Time field or expression.
Learn more.
DATE(year, month, day)
DateDATE_DIFFReturns the difference in days between X and Y (X – Y).
Learn more.
DATE_DIFF(X, Y)
DateDATE_FROM_UNIX_DATEInterprets an integer as the number of days since 1970-01-01.
Learn more.
DATE_FROM_UNIX_DATE(integer)
DateDATETIMEConstructs a Date & Time field or value from numbers.
Learn more.
DATETIME(year, month, day, hour, minute, second)
DateDATETIME_ADDAdds a specified time interval to a date.
Learn more.
DATETIME_ADD(datetime_expression, INTERVAL integer part)
DateDATETIME_DIFFReturns the number of part boundaries between two dates.
Learn more.
DATETIME_DIFF(date_expression, date_expression, part)
DateDATETIME_SUBSubtracts a specified time interval from a date.
Learn more.
DATETIME_SUB(datetime_expression, INTERVAL integer part)
DateDATETIME_TRUNCTruncates a date to the specified granularity.
Learn more.
DATETIME_TRUNC(date_expression, part)
DateDAYReturns the day of a Date or Date & Time.
Learn more.
Day(date_expression)
DateEXTRACTReturns part of a Date or Date & Time.
Learn more.
EXTRACT(part FROM date_expression)
DateFORMAT_DATETIMEReturns a formatted date string.
Learn more.
FORMAT_DATETIME(format_string, datetime_expression)
DateHOURReturns the hour of a date and time.
Learn more.
HOUR(datetime_expression)
DateMINUTEReturns the minutes component of a given date and time.
Learn more.
MINUTE(datetime_expression)
DateMONTHReturns the month from a Date & Time value.
Learn more.
MONTH(date_expression)
DatePARSE_DATEConverts text to a date.
Learn more.
PARSE_DATE(format_string, text)
DatePARSE_DATETIMEConverts text to a date with time.
Learn more.
PARSE_DATETIME(format_string, text)
DateQUARTERReturns the quarter of the year for a given date.
Learn more.
QUARTER(date_expression)
DateSECONDReturns the seconds component of a given date and time.
Learn more.
SECOND(datetime_expression)
DateTODATEReturns a formatted compatibility mode Date. Learn more.TODATE(X, Input Format, Output Format)
DateTODAYReturns the current date as of the specified or default timezone.
Learn more.
TODAY([time_zone])
DateUNIX_DATEReturns the number of days since 1970-01-01.
Learn more.
UNIX_DATE(date_expression)
DateWEEKReturns the week number for a given date.
Learn more.
WEEK(Date)
DateWEEKDAYReturns a number representing the day of the week for a given date.
Learn more.
WEEKDAY(Date)
DateYEARReturns the year of a given date.
Learn more.
YEAR(Date)
DateYEARWEEKReturns the year and week number of a given date.
Learn more.
YEARWEEK(Date)
GeoTOCITYReturns the city name for X.TOCITY(X [,Input Format])
GeoTOCONTINENTReturns the continent name for X.
Learn more.
TOCONTINENT(X [,Input Format])
GeoTOCOUNTRYReturns the country name for X.
Learn more.
TOCOUNTRY(X [,Input Format])
GeoTOREGIONReturns the region name for X.
Learn more.
TOREGION(X [,Input Format])
GeoTOSUBCONTINENTReturns the sub-continent name for X.
Learn more.
TOSUBCONTINENT(X [,Input Format])
MiscellaneousCASTCast field or expression into TYPE. Aggregated fields are not allowed inside CAST.TYPE can be NUMBERTEXT, or DATETIME.
Learn more.
CAST(field_expression AS TYPE)
MiscellaneousHYPERLINKReturns a hyperlink to the URL, labeled with the link label.
Learn more.
HYPERLINK(URL, link label)
MiscellaneousIMAGECreates Image fields in your data source
Learn more.
IMAGE(Image URL, [Alternative Text])
MiscellaneousNATIVE_DIMENSIONReturns the result of a SQL expression as evaluated by the underlying dataset. The expression cannot include any aggregations.
Learn more.
NATIVE_DIMENSION("JSON_VALUE('{"name": "Dana"}', '$.name')","STRING")
TextCONCATReturns a text that is the concatenation of X and Y.
Learn more.
CONCAT(X, Y)
TextCONTAINS_TEXTReturns true if X contains text, otherwise returns false. Case-sensitive.
Learn more.
CONTAINS_TEXT(X, text)
TextENDS_WITH Returns true if X ends with text, otherwise returns false. Case-sensitive.
Learn more.
ENDS_WITH(X, text)
TextLEFT_TEXT Returns a number of characters from the beginning of X. The number of characters is specified by length.
Learn more.
LEFT_TEXT(X, length)
TextLENGTHReturns the number of characters in X.
Learn more.
LENGTH(X)
TextLOWERConverts X to lowercase.
Learn more.
LOWER(X)
TextREGEXP_CONTAINSReturns true if X contains the regular expression pattern, otherwise returns false.
Learn more.
REGEXP_CONTAINS(X, regular_expression)
TextREGEXP_EXTRACTReturns first matching substring in X which matches the regular expression pattern.
Learn more.
REGEXP_EXTRACT(X, regular_expression)
TextREGEXP_MATCHReturns true if X matches the regular expression pattern, otherwise returns false.
Learn more.
REGEXP_MATCH(X, regular_expression)
TextREGEXP_REPLACEReplaces all occurrences of text which matches the regular expression pattern in X with the replacement string.
Learn more.
REGEXP_REPLACE(X, regular_expression, replacement)
TextREPLACEReturns a copy of X with all occurrences of Y in X replaced by Z.
Learn more.
REPLACE(X, Y, Z)
TextRIGHT_TEXT Returns a number of characters from the end of X. The number of characters is specified by length.
Learn more.
RIGHT_TEXT(X, length)
TextSTARTS_WITH Returns true if X starts with text. Otherwise, returns false. Case-sensitive.
Learn more.
STARTS_WITH(X, text)
TextSUBSTRReturns a text that is a substring of X. The substring begins at start index and is length characters long.
Learn more.
SUBSTR(X, start index, length)
TextTRIMReturns X with leading and trailing spaces removed.
Learn more.
TRIM(X)
TextUPPERConverts X to uppercase.
Learn more.
UPPER(X)
Scroll to Top