Learn how to use the Add field from calculation transformation.
Estimated time: 2 min
Create an Add field from calculation transformation
The add field from calculation transformation allows you to create a new column by performing a custom calculation on one or more existing fields in your data. Use this for when you need to create a new field, such as calculating the total, difference, percentage, or ratio.
To use the add field from calculation transformation, complete the following steps:
Open your dashboard in edit mode.
Click Transformations tab and click + Add transformation button.
Select or search for Add field from calculation.
Under Mode, select how you want your calculation to be applied.
Use the following table as a guideline for when to use the different modes.
Mode
When to use
Binary
When you want to apply basic binary operations on values in a single row from two selected fields.
Unary
When you want to apply basic unary operations on values in a single row from a selected field.
Reduce row
When you want to apply selected calculation on each row of selected fields independently.
Row index
When you want to insert a field with the row index.
Cumulative functions
When you want to apply functions on the current row and all preceding rows.
Window functions
When you want to apply window functions.
For modes with the Operation or Calculation option, select the operation and calculation that you want to perform.
Add a new name to the new field by updating Alias.
The transformation should be applied automatically. If not, click Refresh to verify the visualization looks as intended.
The following image shows an add field from calculation transformation with a binary operation. The transformation calculates the Average Views per User by dividing the Page views with Unique users.
Save your dashboard.
More to explore (optional)
At this point in your journey, you can explore the following paths: