Description
Allows a user to create new column values by applying expressions, the result can be a new defined column or it can replace the existing column value.
Configuration
To add the Calculated Field Transformation to a stream, follow the steps below:
- Ensure you have a use case open in the stream designer, this can be a new use case or an existing use case
- From the toolbox on the left expand the Transformation option and scroll down until you can see “Calculated Field Transformation”
- You can also use the search in the header to find the stream object quickly
- Click and drag the Calculated Field Transformation from the toolbox onto the canvas
- Rename the Transformation by clicking into the text button on the action bar
- Save the Stream by clicking the save button in the action bar
- Hover over the icon for the stream object until it turns orange and then double click to open the configuration page
- You can optionally use the configure option on the action bar once you have selected the specific stream object and then clicking this option
- Configuration options
- The drop-down allows you to associate this stream object with a specific collection. The default option is derived from the default specified against the specific use case and is generated left as the same option. If you do need to change it to another collection make the change by selecting the new collection in the drop-down.
- Enter Editor details.
- Click on the “+”-button to add new rows. You can use a calculated field in another calculated field’s expression using {}. Example: Col2 = {Col1} *2
- Select Calculated Field from drop-down list
- Enter Expression
- Select Data Type from drop-down list
- Select Results Returned As from drop-down list: Append to Current or New
- Click Apply on the action bar, and then save the stream using the save button.
Examples
The items listed below are examples of how the Derived Column Editor can be configured to create new columns using expressions.
Strings
Create a new string using data points from the stream. Please note that you have to add a “+” sign to add the string values together.
To create a hard-coded new string value:
If-statement Date and Time Get the current date and time and adding additional days to the date: Larger than
Using the short-hand If-statement the following reads “If the vibration is larger than 9000 then value is High otherwise it’s Medium”
Current date and time
This will return true or false. Please note that the Data Type needs to be set to Boolean.
Limitations
- None at this time.
Release Notes
Version: | 3.14 |
Released: | 09-Sep-2019 |
Release Notes: | Added the ability to use one calculated field in another calculated field’s expression |
Version | Released | Release Notes |
3.13 | 09-Sep-2019 | Fixed issues with Payload selection. |
3.12 | 04-Sep-2019 | Upgraded System.Linq.Dynamic.Core. |
3.11 | 27-Aug-2019 | Added option to specify Existing With New or only New columns as output. |
3.10 | 19-Aug-2019 | * Added validation for field identifiers. * Added Error output when calculation fails. |
3.09 | 21-June-2019 | Change name to Calculated Field and update icon. |
3.08 | 4-March-2019 | Updated help URL. |
3.07 | 22-May-2018 | Fixed outputs that overwrite input fields not having the specified output type. |
3.06 | 11-May-2018 | Added DateTime type to list of derived output types. |
3.05 | 10-May-2018 | Fixed null-reference exceptions in GetOutputAttributes. |
3.04 | 10-May-2018 | Fixed “ToInt is not a valid method” exception. |
3.03 | 10-May-2018 | Fixed “Operator cannot be applied to operands of type Object and …” exceptions. |
3.02 | 26-Apr-2018 | Updated DLL. |
3.01 | 19-Apr-2018 | Changed Agent state to Virtual. |
3.0 | 19-Apr-2018 | Initial Release. |