Using Dynamic Columns

The below tutorial will cover what dynamic columns are and how they can be used.

Dynamic Columns

Dynamic Columns are similar to calculated columns except you write the code as a C# property in a class file. They allow you to use the full .NET framework, enabling you to make complex data transformations.

In it's most basic form a Dynamic Column is simply the result of a C# Property getter the name of the Property becomes the column name and the result is calculated at runtime during Data Load.

public string MyNewProperty
{
    get {return "myProperty";}
}

The Dynamic Column class is created just before the Data is loaded for Data Source A, this single instance is valid for the duration of the load and BeginRow() is called for each row giving you a chance to set your property values.

Returning False from BeginRow() will filter the row from the result.

The Start() method allows you set any initialisation you need before the rows are processed.

Enable

To enable Dynamic Columns either press the Dynamic Columns button on the shortcut menu or go to View > Dynamic Columns.

This will open the Dynamic Columns tab. Click Enable Dynamic Columns to create the initial Dynamic Columns class template.

Enable Dynamic Columns

This will then open a code view.

Code View Dynamic Columns

Remove

To remove a single dynamic column, simply delete the Property Declaration from the Class.

To remove all Dynamic Columns, simply delete all the code from the Dynamic Columns window.

Create Calculated Column Function

If you create a function you need to call multiple times, it is preferred to create the function in Dynamic Columns and use Calculated columns to call it.

To do this add a public method to the Dynamic Columns class, which will make it available to Calculated Columns. Make sure to press Build to load your new column into the source window.

This column will then appear in your Source window under dynamic columns. To add this to your schema check the checkbox next to the dynamic column.

Dynamic Column