Intro
Refer to this article for help in writing Beast Mode calculations for basic transforms such as renaming a column, creating a custom sort order, filtering values, and so on.Rename a Column
You can use a calculation to rename a column in your data. For example, to rename a column named “daily_total” to “Daily Total”, create a calculation named “Daily Total” with the following code:`daily_total`
If you want to sum the column, use the following code:
sum(`daily_total`)
After saving your calculation, click the new column name in the Columns list to display the column in your card.
Change Values in a Column
You can use a calculation to change a specified column value to a different value. For example, if you had a column called “Employee Last Name” and you wanted to change all instances of “Janssen” in the column to “Janssen-Soderquist,” you would create a calculation with the following code:Filter Values in a Column
You can filter values in a column by creating a calculation, then setting a filter to include or exclude the fields with the value you want. For example, assume you have a column of US states and you want to filter outState = TX, use this code:
Force a Sort Order
You can tell Beast Mode to sort data the way you want.Remove Numbers from Text
To remove numbers from text fields (for example, the fields include a name and ID number and you want just the names), use a Beast Mode calculation like this:SUBSTRING(`text_Field`,INSTR(`text_Field`,' ')+1)
Replace the text_Field text with the name of the column you want to remove numbers from. This will give you the string from the first space to the right.