Adding a Custom Column
The ElastiCube Manager makes it easy for you to add new columns to existing tables. This can be useful if you need to combine data from different existing columns, and when you need to cleanse and prepare data. The new columns also provide designers with additional fields to use as is, or as a basis for even more advanced calculations in their widgets. You can use SQL to customize the values contained within the custom columns.
To add a new column:
- In the left pane, select > Add Custom Column. Click here to learn more.
In the schema, select the table and click and Add Custom Column.
- The new column will be added to the table, and the column's settings window is displayed with the following options:
Name: Click the column name in the settings window to rename or edit the column name.
- Type: When you create the column, it defaults to the type of data you added. From the left pane of your schema, you can modify this by clicking the field name’s Type icon and selecting a new type.
- Expression: You can use SQL to customize the data contained in the new field. See Defining and Editing Column Formulas for further details on developing field expressions.
To delete a custom field, click the field and click Remove.
Note: Column data can be converted to a different type using functions. For example, a number can be converted to a text field. See the function reference for more details.
Custom Field Use Cases
Here are some typical scenarios for creating custom fields.
Row Level Calculations
Calculate revenue from your sales data.
Gross Revenue = (Unit Price * QuantitySold)
Net Revenue = (Unit Price * QuantitySold) - (Unit Cost * QuantityPurchased)
Time Difference Calculations
Work out the arrival time based on due and actual arrival dates.
Compare your price to the competitor’s price.
Create data buckets according to your required business break points.
WHEN [PriceVsCompetitor%] < -0.05 THEN '-5%'
WHEN [PriceVsCompetitor%] >= -0.05 AND [PriceVsAvgCompetitor%] <= 0.05 THEN '-5%/+5%'
WHEN [PriceVsCompetitor%] > 0.05 THEN '+5%'
Create attributes to translate data talk to more coherent categories.
WHEN Region = 1 THEN 'USA'
WHEN Region = 2 THEN 'EUR'
WHEN Region = 3 THEN 'ASIA'
Convert dates into a numeric representation.
getyear(Date)*10000+getmonth(Date)*100+getday(Date) AS DateNum
Convert text into dates.
Date Period Comparisons Over Time
Create month to date and year to date calculations.
Click here to read our support article.
Importing from Another Table
Use the lookup function to import a column from a different table. Click here to read more.