Intro
This reference guide describes supported functions in Beast Mode.Supported Functions
You can use any of the following functions in calculations. You can see examples of many of the functions in the following articles:- Sample Basic Transforms
- Sample Card Element Transforms
- Sample Date Transforms
- Sample Mathematical Transforms
- Sample Miscellaneous Transforms
- Sample Period-over-Period Transforms
Aggregate Functions
Function Name | Description | Example |
|---|---|---|
| Returns the approximate count of a number of unique values in a column. |
|
| Returns the average value for each series in a column. |
|
| Returns the highest value for each series in a column. This function differs from the |
|
| Returns the number of row values in a column. |
|
| Returns the count of a number of unique values in a column. |
|
| Returns the lowest value for each series in a numeric column. This function differs from the |
|
| Returns the highest value for each series in a numeric column. This function differs from the |
|
| Returns the lowest value for each series in a numeric column. This function differs from the |
|
| Returns the population standard deviation for each series in a numeric column. |
|
| Returns the sum of each series in a numeric column. |
|
| Returns the sum of unique values in a numeric column. |
|
| Returns the population standard variance for each series in a numeric column. |
Mathematical Functions
Logical Functions
Function Name | Description | Example |
|---|---|---|
| Use to begin logical statements in which the value of data is replaced when certain criteria is reached (when…then or when…then, else). These statements use the following format: or
In other words, when the data in the “Value” column equals number x , value resultx is returned; otherwise value resulty is returned. (The value returned can be either a single-quoted string or a number.) For multiple conditional statements, use the following format: Although valid, avoid using the following inefficient format: IN Operator LIKE Operator
Values for the | |
| Used in logical statements in which you want to specify a replacement for null values. |
|
| Returns null if the value in the first column equals the value in the second column; otherwise returns the value in the first column. |
|
String Functions
Function | Description | Example |
|---|---|---|
| Combines strings from two or more string columns. |
|
| Returns the position of the first instance of a specified string in a given column, starting from the first letter in the name. In the example at right, the calculation would return the position of the first instance of the letter “e” in each string in the column. |
|
| Returns the specified number of characters in each string in the the given column, starting from the left. |
|
| Returns the number of characters in each string in the given column. |
|
| Converts strings from one or more string columns into lower-case. |
|
| Replaces all of the specified strings in a given column with another specified string. |
|
| Returns the specified number of characters in the given column, starting from the right. |
|
| Extracts and returns a specified number of characters from the values in a string column. You specify the characters to return by indicating the starting position and the length of characters. For example, specifying the position as 1 and the length as 3 would return the first, second, and third characters for values in the column. |
|
| Trims leading and trailing spaces for all values in string columns. |
|
| Converts strings from one or more string columns into upper-case. |
Date and Time Functions
WEEKDAY function is not supported in Beast Mode. If WEEKDAY is used, it is replaced with the functionality of DAYOFWEEK.Function | Description | Example |
|---|---|---|
| Adds date or datetime values (as intervals) to date values in a date column. You can specify the date or datetime values to add to date values in a date column by specifying the column, interval, expression, and unit, as in You can prefix the expression with a ”-” to subtract the value. Specify the unit value (such as second, minute, hour, day, week, month, quarter, year). (The “interval” keyword and unit type values are case insensitive.) For more information, see Unit type values in Beast Mode. For example, adding 12 days to Same as |
|
| Adds a specified number of seconds to all values in a time column. For example, adding 15 seconds to |
|
| Returns the current date. No column name is specified in this function. Same as |
|
| Returns the current time. No column name is specified in this function. Same as |
|
| Returns the current date. No column name is specified in this function. Same as |
|
| Returns the current time. No column name is specified in this function. Same as |
|
| Returns the value of current date and time in No column name is specified in this function. Same as |
|
| Extracts and returns the dates from datetime values. |
|
| Returns the number of days between two dates from datetime values. |
|
| Adds date or datetime values (as intervals) to date values in a date column. You can specify the date or datetime values to add to date values in a date column by specifying the column, interval, expression, and unit, as in You can prefix the expression with a ”-” to subtract the value. Specify the unit value (such as second, minute, hour, day, week, month, quarter, year). (The “interval” keyword and unit type values are case insensitive.) For more information, see Unit type values in Beast Mode . For example, adding 12 days to Same as |
|
| Formats dates in a date/time column into a specific format. You can specify the format to use for a date or time column by specifying the column and the date or time string, as in The ”%” character is required before format specifier characters. For example, using For information about specifier characters, see Date Format Specifier Characters in Beast Mode . Similar to |
|
| Subtracts date or datetime values (as intervals) to date values in a date column. You can specify the date or datetime values to subtract from date values in a date column by specifying the column, interval, expression, and unit, as in You can prefix the expression with a ”-” to add the value. Specify the unit value (such as second, minute, hour, day, week, month, quarter, year). (The “interval” keyword and unit type values are case insensitive.) For more information, see Unit type values in Beast Mode . For example, subtracting 12 days from Same as |
|
| Returns the numerical day of the month for all values in a date/time column. Same as |
|
| Returns the name of the day of the week for all values in a date/time column. |
|
| Returns the numerical day of the month for all values in a date/time column. Same as |
|
| Returns the numerical day of the week for all values in a date/time column (e.g. “2” for “Monday”). |
|
| Returns the numerical day of the year for all values in a date/time column (e.g. “226” for the 226th day of the year). |
|
| Converts day numbers into dates. |
|
FROM_UNIXTIME | Returns a UNIX datetime value from a UNIX date/time column using the specified format. For information about specifier characters, see Date Format Specifier Characters in Beast Mode . |
|
| Returns the hour for all values in a date/time column (e.g. the time “3:36” would return “3”). |
|
| Aggregates values for each month in a date/time column and returns each aggregation as the last day of each month. For example, if a date/time column had “15,” “16,” and “17” as values for January, only the last given date of January would appear, with a combined value of 48. |
|
| Returns the value for each minute in a time column. If there is more than one instance of a particular minute in the column, the values for those minutes are aggregated. |
|
| Returns the month number (e.g. “9” for September) for all values in a date/time column. |
|
| Returns the name of the month (e.g. “September” rather than “9”) for all values in a date/time column. |
|
| Returns the value of current date and time in No column name is specified in this function. Same as |
|
| Adds the specified number of months to the values in a date column. For this to work, the date values must be months in the format |
|
| Returns the number of months between months in two date columns. For this to work, the date values must be months in the format |
|
| Aggregates date value data into quarters in a year. |
|
| Returns the value for each second in a time column. If there is more than one instance of a particular second in the column, the values for those seconds are aggregated. |
|
| Converts seconds into hours, minutes, and seconds. For example, |
|
| Converts strings (that Domo does not recognize as dates) from one or more string columns into datetime values. You specify the column(s) and the current date format used in those columns. By default, datetime values are returned in the output format For information about specifier characters, see Date Format Specifier Characters in Beast Mode . |
|
| Subtracts date or datetime values (as intervals) to date values in a date column. You can specify the date or datetime values to subtract from date values in a date column by specifying the column, interval, expression, and unit, as in You can prefix the expression with a ”-” to add the value. Specify the unit value (such as second, minute, hour, day, week, month, quarter, year). (The “interval” keyword and unit type values are case insensitive.) For more information, see Unit type values in Beast Mode . For example, subtracting 12 days from |
|
| Subtracts a specified number of seconds from all values in a time column. For example, subtracting 30 seconds from |
|
| Returns the current date and time in YYYY-MM-DD HH:MM:SS format, as in No column name is specified in this function. Similar to |
|
| Extracts the times from datetime values. |
|
| Returns the difference between values in two date/time columns, expressed as a time value. |
|
| Returns values in a date column as datetime values. |
|
| Formats time in a datetime column into a specific format. You can specify the format to use for time values in a time column by specifying the column and the time string, as in The ”%” character is required before format specifier characters. For example, using For information about specifier characters, see Date Format Specifier Characters for Beast Mode Similar to |
|
| Returns an elapsed number of seconds for all values in a date/time column. |
|
| Returns the number of days since year 0 for all values in a date/time column. For example, the date “01-06-2010” would be returned as “734143,” since 734,143 days have transpired between that date and January 1st of year 0. |
|
UNIX_TIMESTAMP | Returns UNIX time stamps for all values in a date/time column. | UNIX_TIMESTAMP( |
WEEK | Returns the week number for each value of the indicated date or date-time column. Syntax: For a Sunday-Saturday week frame, use mode 11: For a Monday-Sunday week frame, use mode 22: | WEEK( |
| Returns the year for all values in a date/time column. |
|
| Returns the year and week number for each value of the indicated date or date-time column in “YYYYWW” format. For example, a date in the 5th week of the year 2020 will return “202005”. Syntax: For a Sunday to Saturday week frame, use mode 11: For a Monday to Sunday week frame, use mode 22: |
|
Apply a Calculation to a Summary Number
If your Beast Mode calculation aggregates rows in your DataSet, you can use it in your card Summary Number. Calculations built using any of the following functions can be applied to your Summary Number:- AVG
- COUNT
- COUNT (DISTINCT)
- MAX
- MIN
- SUM
- SUM (DISTINCT)
- STDDEV_POP, VAR_POP
SUM()
function) or be the result of an operation on values within functions (for example,
SUM()
functions). For instance,
'Customers'
does NOT work for a Summary Number, but
SUM('Customers')
may be used as a Summary Number.Unsupported Functions
The following functions are no longer supported:SQRT
,
CONVERT_TZ
,
MICROSECOND
,
WEEKDAY