Append Data Column

From PresenceWiki
Revision as of 07:35, 21 August 2015 by Rob (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Append Data Column

This Node appends an extra Data Column to the Presence Data Table with the value specified in the input dialog:


Append column dialog.png


Please see the illustration below for an example of how this works:

Append column example.png

The resulting table from this operation would contain four columns, with the last one being the one that was appended.

Rather than specify the new value for each row individually, it is common to use functions in combination with Append Columns to create a new column whose value is based on the values of other columns in the row.

Data Types

In the Append Column dialog there is a dropdown to specify the type of data. The following options are available:

  • String - e.g. "Bob"
  • Integer - e.g. 26
  • Double - e.g. 3.141596
  • Date (yyyy-MM-dd) - e.g. 2010-06-17
  • Time (HH:mm:ss) - e.g. 17:30:00
  • Boolean - e.g. "true" or "false"
  • Java Object

This determines how Presence stores the new value internally and can make it easier to use the value in subsequent nodes, for example when inserting into a database with dynamic markers.

This also assists with data validation. If the resolved value of the column cannot be converted to the selected type an error will be thrown, which can be caught by an Error Handler node and dealt with appropriately in your Task.

Multiple Column Appender

This performs the same functionality as the Append Data Column, but allows you to group together several append columns in one node:

Multiple column appender.png

This screen is split into two halves - on the left is a list of new columns (this will be blank when first launched). Below this list are the following buttons:

  • New Column
  • Edit Column Name
  • Move Column Up
  • Move Column Down
  • Clear Column
  • Sort Columns Alphabetically

When a new column is created a properties sheet will be visible on the right side of the screen, which is similar to the dialog box presented by the individual Append Column node.

To rename a Column, either double click on the column in the list, or right-click the column and select "Rename Column" from the pop-up menu.

Applying Rules

If Rules are set on an append column the value will only be set if the rest of the row conforms to the conditions applied. If the conditions are not met a Null value will be placed instead.

To apply Rules to an individual Append Column Node, right click on the Node in your Task and select Rules > Set Rules from the pop-up menu.

To apply Rules to a new Column in a Multi Column Appender, right click on the item from the left-hand list and select "Rules > Set Rules" from the pop-up menu there.



Data Filter | Require Columns | Append Data Column | Multiple Column Appender

Drop Column | Drop Row(s) | Calculate Column Aggregate | Dataset Splitter | Merge Data

Create Data Table | Clear Data Table | Sort Data Table | Drop Duplicate Rows | Store Data Table | Retrieve Data Table


Task Elements > Data Table Nodes > Append Data Column