Intro
The Add Formula tile is a row-by-row expression evaluator that brings advanced transformation processes to Magic ETL. It supports functions such as case statements, time-value-money functions, and statistical utility functions. Now you can use the AI SQL Assistant to write and test formulas quickly, improving accuracy and giving you more time for other tasks. Learn more about the Add Formula tile.
- Use the AI SQL Assistant
- Configure the Add Formula tile
- Parts of the formula editor
- Calculation usage notes
Use the AI SQL Assistant
Follow these steps to use the AI SQL Assistant to create a formula in the Add Formula tile:- Drag the Add Formula tile from the Utility section of the left panel to the Magic ETL canvas and connect it to your DataFlow.
- In the tile editor below the canvas, choose a name for the output column of the tile.
-
Select Open the formula editor.

-
At the bottom of the Calculation field in the formula editor, use the prompt field to enter your prompt in natural language and describe the calculation you want to create.
In the example below, the prompt is to “categorize
CustomerStateby US region.” After entering the prompt, the SQL query displays in the main Calculation field.
- Save and close to return to the canvas.
Configure the Add Formula Tile
The following screenshot shows how the Add Formula Action looks:
Parts of the Formula Editor (Expanded View)

Calculation Usage Notes
Most calculations use one of the following general formats:Format | Description |
FUNCTIONNAME( | Used when some single, specific change is applied to all of the cells in a column. Examples of functions used in this kind of calculation include AVG, MONTHNAME, and CEILING. |
FUNCTIONNAME( | Used when a calculation is applied across two or more columns. One example of a function used in this kind of calculation is CONCAT, which combines strings from different columns. |
FUNCTIONNAME( | 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( | 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 . |
- Column names are not case sensitive.
- Supported functions are not case sensitive.
-
Use backticks (aka backquotes ) (
) 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.
- You can use most standard arithmetic operators in your custom calculations, such as + (addition), - (subtraction), * (multiplication), / (division), and so on.
- You can refer to a specific new column by name that was created from a formula in a separate calculated formula, as long as the new column being referenced is higher than the formula referencing it.
- 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.
- While you can combine some functions in a calculation, you cannot stack numerical functions. For example, SUM(MIN()) is invalid.
- Do not mix 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.
dropdown to view and select an existing column or type the name of that column exactly to overwrite existing column. When the table icon
appears in the textbox, an existing column will be overwritten by the entered formulas result.
Opens the formula editor expanded view (see screenshot below.)
Quickly validates the formula’s syntax and checks for errors without running a preview of the entire DataFlow.