Create a computed column
Use a computed column to add a column of information to a table or worksheet typically using the information from one or more existing columns.
Computed columns are columns you create yourself in many cases using information that is already in the table with which you are working. For example, suppose you have a table that contains all the sales data for a chain of stores. This table has one column called Sales, which is the purchase price paid by the customer. It has another column called Cost, which is the cost of the item to the retailer. With a computed column, it is easy to create a third column called Margin that contains the difference between the sale price and the cost.
To create a computed column:
-
In the New operation panel, click
Compute.
The Trillion-Row Spreadsheet displays the Compute panel.
-
Complete the following fields:
Name Enter the name that you want to assign to the computed column.
This is the name the 1010data Insights Platform uses to interact with the column. It is also used when writing more advanced value expressions and queries.
The column name must be unique. It may only contain alphanumeric characters or underscores and must begin with an alphabetic character (e.g., percent_total_sales). It may not contain any spaces or other special characters.
This is a required field.Note: When entered, the Trillion-Row Spreadsheet (TRS) automatically removes special characters, replaces spaces with underscores, and displays a visual indication that a change was made.When TRS makes these changes, and if nothing has been entered in the Label field, the original text is automatically copied into the Label field.
Label Enter the text that you want to appear at the top of the computed column when the table is displayed.
This is the column heading that displays by default at the top of a column in the user interface.
The column label may contain any combination of uppercase and lowercase letters, numbers, spaces, and special characters. If you want to have a multi-line column label, use the backtick character (`) to separate the lines (e.g., "Percentage of`Total Sales (%)").Note: On most standard United States keyboards, the backtick (`) character is immediately to the left of 1 key.While not required, this field is recommended.
-
In the Expression Editor field, enter a value expression.
The value expression may refer to one or more columns and may include standard arithmetic, relational, and logical operators as well as any of the Insights Platform's functions.Note: When entering a column in an expression, use the column name as opposed to the column label.
For more information, see Writing Expressions in the 1010data Reference Manual. For more information about the Expression Editor, see Expression Editor.
The Compute panel displays a preview of the first three rows of your expression. The preview displays only the column name(s) represented within the expression and the result of the expression. -
Optionally,
to define the format of the computed column, complete the
following:
-
Click the Submit operation () icon.
The Trillion-Row Spreadsheet creates the computed column.