Comment on page
Add new expression-based columns, rename and retype columns
The Edit Columns tool is most often used immediately following an import tool. It can be used in two common ways:
- To rename and retype columns
- Or to add a new column, based on an expression
A sports example. Calculating Batting Average as a New Column
Drag an Edit Columns tool to your workflow canvas. Connect a downstream tabular-data output to the input of of your Edit Columns tool. Click it once to see the tool preview. Click it again to open and configure the tool.
On the right side, you will see your results table, it represents the output of the tool. On the left side, is the configuration panel. Left/right buttons control which column is selected. Column metadata for the selected column is shown underneath.
A sports example
Adjust the metadata fields for the selected column. Make your changes and hit
Enter. Changes can be identified in the results table by looking for the green column header. Reconfigurable column details include:
- Name: Provide a new name for a column, effectively works as a rename
- Type: Assign a specific data type to a column (String, Number-Whole, Number-Decimal, Percent, Datetime, Duration, Boolean)
- Description: Collaborate with team members, provide a column description for others to see
- Format: Assign a specific format to certain data types
Columns can be reordered left to right, from the results table. Using your cursor, grab a column by the column-header, drag it to a new location, and release. The final column order will be represented in the tool output.
To add a new column from the results table, click the dropdown in any column header, then select Insert Right or Insert Left to add a column. Alternately, you can scroll to the far-right of your results table and click the plus button.
Add a new column from the header of the results table: Insert right, insert left, or "+" at the far right of your table
Either selection will open the Expression Builder, near your new column. From the top controls, you may provide a name for your column and you can reposition the Expression Builder using the drag handle on the right. Under the controls is where you write your expression.
Adding derived columns is key to advancing an analysis. The Expression Builder, baked into the Edit Columns tool, is ideal for this task. It's potential is capped only by your imagination (and maybe your source data).
A good look at Expression Builder with a successfully written expression for Batting Average
Use Expression Builder to:
- Mark an entire column a Boolean True or False.
- Tag an entire column with a Text String or a Date Time.
Enterto save and calculate anything you have written in Expression Builder. Be sure to save your expression before exiting the Edit Columns tool.