Skip to main content

Intro

You can use the Beast Mode feature to add a calculated field to transform columns in your chart. Creating a calculated field is available inside Analyzer. Calculated fields are useful when your DataSet has the data you want but not in the format you need, and Magic ETL is not an option. For example, let’s say you’re an accounts payable manager, and your DataSet includes vendor names, due dates, and open balances. You can use a calculated field to find how many weeks some of the open balances are overdue. Learn how to create this calculation below.

Access the Beast Mode Editor

You can access the Beast Mode Editor from inside Analyzer by selecting Create Calculated Field in the DataSet tool.
(If Create Calculated Field doesn’t display, select the DataSet tool to display the panel.)

Create a Calculation

To begin: Open the card to which you want to add a calculation in Analyzer and open the Beast Mode editor. Learn more about Analyzer.
  1. In the editor, select Add Calculated Field.
  2. Enter a title for your calculation in the Column name field.
  3. In the Calculation field, enter your calculation. You can add column names, Variables, and functions to your calculation using the Columns, Variables, and Functions tabs and double-clicking the item you want to add. See the Beast Mode functions reference.

    For our accounts payable example from the intro, you can use the following formula to find the number of weeks overdue, rounded up.

    CEILING(DATEDIFF(CURRENT_DATE(),`Due Date`)/7)

  4. Validate the calculation.
    Note: You can use the Beast Mode AI assistant to create a Beast Mode by entering natural language and copying the result into the Calculation field. Learn more about the Beast Mode AI Assistant.
  5. (Optional) Check the box labeled Save calculation to DataSet.
    Note: Saving a calculation to a DataSet makes the calculation available to any other cards that use this DataSet.
  6. Select Save Calculated Field to validate the syntax of the calculation and save your changes. If there are errors, revise your calculation. After saving, the calculation column appears in the Calculated fields list for the card in Analyzer.

Edit a Calculation

Follow these steps to edit an existing Beast Mode calculation: To begin: Open the card that contains the Beast Mode calculation you want to edit in Analyzer.
  1. Under Calculated fields in the DataSet panel, select the calculation you want to edit to open in the Beast Mode editor.
  2. Make any changes to the calculation and validate it. Then select Save Calculated Field to keep your changes.

Delete a Calculation

Note: You cannot delete a calculation that is being used in any other cards. To delete a calculation, you must first remove it from all other cards.
To begin: Open the card that contains the Beast Mode calculation you want to remove in Analyzer.
  1. Under Calculated fields in the DataSet panel, hover over the calculation you want to remove until the Remove option displays.
  2. Select Remove. If the calculation isn’t being used in any other cards, you can delete it.
    Screenshot 2023-06-20 at 7.39.40 PM.png
    Otherwise, a Cannot delete selected Beast Modes dialog displays, advising that the calculation is being used in cards. Remove the calculation from those cards before attempting to delete it.
    Screenshot 2023-06-20 at 7.41.33 PM.png

Usage Notes

Most calculations use one of the following general formats:

Format

Description

FUNCTIONNAME(Column Name)

Used when some single, specific change is applied to all of the cells in a column.

Examples: AVG , MONTHNAME , and CEILING .

FUNCTIONNAME(Column Name1,Column Name2,…)

Used when a calculation is applied across two or more columns.

Example: CONCAT (combines strings from different columns)

FUNCTIONNAME(Column Name, somevalue )

Used when a calculation involving a specified value is applied to a column.

An example of a function used in this kind of calculation is POWER . When using this calculation, you specify the power you want all the cells in a column to be raised to.

FUNCTIONNAME(Column Name, ’ string ’)

Used when a calculation involving a specified string is applied to a column.

An example of a function used in this kind of calculation is DATE_FORMAT . When using this calculation, you specify specifier characters to use in formatting the date value.

For more information, see Date Format Specifier Characters in Beast Mode .

Casing and Naming
  • In calculations, function names are NOT case-sensitive.
  • In calculations, column names ARE case-sensitive and are separated by commas.
  • Do NOT use function names as column names; function names are reserved.
  • You CANNOT refer to a specific calculation by name in another calculation. For example, if you create a calculation called “MaxColumn1,” you cannot use that name when defining another calculation.
Quotes
  • Use backticks (`) or double quotes (”) for column names: `Customers` or "Customers" Wrap column names of two or more words with backticks (`) or double quotes (”). If you use any column name that matches the name of a function (such as DATE ), then use backticks or double quotes (”) to wrap the column name.
  • Use single quotes (’) for strings: ' mystring '
  • You can escape a quote using two single quotes: ' O' ' Neal '
  • You can insert a space in a calculation using single quotes: ' ' This is useful with functions like CONCAT when you need to combine strings.
Calculations
  • You can use most standard arithmetic operators in your custom calculations, such as + (addition), - (subtraction), * (multiplication), / (division), and so on.
  • You can make selecting Filter options easier by using Yes and No rather than 1 and 0 in a calculation.
  • Do NOT mix the data types of values you put in a transformed column. For example, in a CASE function, do not store Yes (string) and 0 (number) in the same column.
  • Calculations can be completed automatically as you enter them.
    • As you enter functions, a list of functions appears, which you can select from.
    • If you enter a backtick (’), a list of column names appears, which you can select from.
  • If your calculation aggregates rows in your DataSet, you can apply it to your card Summary Number.
  • While you can combine some functions in a calculation, you CANNOT stack numerical functions. For example, SUM(MIN()) is invalid.
  • Calculations you create using the Beast Mode editor are inherited when you drill from one view to another using the same DataSet. However, calculations are not inherited when you drill to a new DataSet. For information about Drill Paths, see Add a Drill Path to Your Chart.
  • You can drag and drop a column name from the DataSet Fields tab to your calculation.
  • Using any calculations that use processing-intensive functions such as COUNT (DISTINCT) or SUM (DISTINCT) slows down the visualization performance of cards that are built off of large DataSets. This also happens with complex case statements that are over 30 lines of code. If you have to build these functions into a large DataSet, we recommend you do it in a DataFlow to optimize visualization performance.
The Beast Mode category in the Knowledge Base contains various examples of sample calculations, separated into basic transforms, card element transforms, date transforms, mathematical transforms, period-over-period transforms, and miscellaneous transforms. Video - Creating a Calculated Field
Video - Case Statement Overview