ComputedColumnNodeEditor Documentation
Overview
The ComputedColumnNodeEditor component is a dual-mode formula builder used within the Vantage data platform. It allows users to create computed columns by performing various operations on existing data columns. Users can either use a simplified visual interface or an advanced text-based mode to construct formulas, thereby enhancing data analysis capabilities.
Purpose
The primary purpose of the ComputedColumnNodeEditor is to enable users to derive new data points dynamically by applying arithmetic, string manipulation, date extraction, and other functions to existing data columns. This functionality is crucial for analyzing large datasets and garnering insights that inform decision-making.
How It Works
The component consists of two main modes:
- Simple Mode - Users select source columns, operations, and input values from dropdown menus. It is designed for users who prefer a straightforward approach.
- Advanced Mode - Users can write raw expressions utilizing function references for complex operations. This mode is intended for advanced users familiar with the syntax of the functions.
The component maintains an internal state representing the current mode, a list of columns, and their associated expressions. When users add, remove or modify a computed column, the component updates its state and reflects these changes in the visual representation.
Settings
The ComputedColumnNodeEditor has several configurable aspects to customize its behavior. Below is a detailed description of each setting:
Mode
- Name:
mode - Input Type: String
- Description: Determines the current operational mode of the editor. The modes are either
'simple'or'advanced'. - Default Value:
'simple' - Effect: Switching modes alters the interface, switching between dropdowns for simple operations and a text input for advanced expressions, affecting usability and accessibility based on user expertise.
Columns
- Name:
columns - Input Type: Array of Objects
- Description: An array of objects defining the computed columns to be created. Each object corresponds to a column structure including its properties like source column, operation, and additional values.
- Default Value:
[](Empty array) - Effect: Updating this array adds or removes computed columns, triggering recalculation and rendering of expressions for the displayed columns.
SourceColumn
- Name:
sourceColumn - Input Type: String
- Description: Refers to the column in the dataset that serves as the base for calculations. It must be an existing column name in the upstream data.
- Default Value:
''(Empty string) - Effect: Changing this will affect the derived results of the computed column since it changes the reference point for calculations.
Operation
- Name:
operation - Input Type: Dropdown String
- Description: Represents the mathematical or string operation to be performed on the
sourceColumn. Options include methods like addition, subtraction, concatenation, etc. - Default Value:
''(Empty string) - Effect: The choice of operation dictates how the result column will be computed. Incorrect selections can lead to errors or void outputs.
SecondColumn
- Name:
secondColumn - Input Type: String
- Description: An optional secondary data column used in conjunction with the selected operation when necessary, such as in arithmetic operations.
- Default Value:
''(Empty string) - Effect: Depending on the chosen operation, this column's value will impact the computation and resultant output.
SecondValue
- Name:
secondValue - Input Type: Numeric/String
- Description: A numeric or text value used as an operand in operations that require it, such as constants in arithmetic functions or specific text to be replaced.
- Default Value:
''(Empty string) - Effect: If required, this impacts operations that apply fixed values or conversions, directly influencing the computed outcome.
ThirdValue
- Name:
thirdValue - Input Type: String
- Description: An additional parameter for operations that require three inputs, especially relevant for replace operations where both the old and new text must be defined.
- Default Value:
''(Empty string) - Effect: Alters the output when particular functions necessitate it, ensuring complete and accurate transformations.
Use Cases & Examples
Use Case 1: Financial Reporting
In a financial dashboard, users can calculate the total revenue after taxes. By combining the price and tax columns, they can display a computed column that approximates total revenue.
Use Case 2: Customer Insights
A marketing team might analyze customer names to create personalized messages. By concatenating first_name and last_name, they can generate a full name column to be used in targeted campaigns.
Configuration Example for Use Case 1
To implement the total revenue computation:
- Source Column:
- Value:
price
- Value:
- Operation:
- Value:
add
- Value:
- Second Column:
- Value:
tax
- Value:
- Second Value:
- Value:
0(default if using another numeric field)
- Value:
Using these configurations, the output expression will auto-generate to price + tax, summarizing total revenue in a new computed column.
Conclusion
The ComputedColumnNodeEditor serves as a powerful tool for derivations and computations on datasets within the Vantage platform. Through its flexible mode system, it accommodates both beginner and advanced users, making it an essential component for enhancing analytical capabilities.