Pivot<TInput>

Class Pivot<TInput>

Use the Pivot transformation to pivot your data. Example:

Month,MonthValue Jan,100 Feb,200 Mar,300

will become

Jan,Feb,Mar 100,200,300

Inherited Members
Namespace: ETLBox.DataFlow
Assembly: ETLBox.dll
Syntax
    public class Pivot<TInput> : DataFlowTransformation<TInput, ExpandoObject>, IDataFlowTransformation<TInput, ExpandoObject>, IDataFlowSource<ExpandoObject>, IDataFlowSource, IDataFlowDestination<TInput>, IDataFlowDestination, IDataFlowComponent, ILoggableTask
Type Parameters
NameDescription
TInput

Type of incoming rows

Constructors

Pivot()

Declaration
    public Pivot()

Properties

ColumnNameGenerationFunc

If set, this function is used to generate the column name for the pivoted columns. Otherwise, the output will concatenate the names of the pivot columns.

Declaration
    public Func<Dictionary<string, object>, string> ColumnNameGenerationFunc { get; set; }
Property Value
TypeDescription
Func<Dictionary<string, object>, string>

DuplicateAggregationFunc

When working on non-aggregated input data, only the last values is used in the Pivot. Use the DuplicateAggregationFunc to define how to handle duplicates in the input data.

Declaration
    public Func<Pivot<TInput>.PivotDuplicate, object> DuplicateAggregationFunc { get; set; }
Property Value
TypeDescription
Func<Pivot<TInput>.PivotDuplicate, object>

KeepEmptyValues

If set to true, all rows will contain all columns, even if they are empty (null).

Declaration
    public bool KeepEmptyValues { get; set; }
Property Value
TypeDescription
bool

MaxBufferSize

Declaration
    public int MaxBufferSize { get; }
Property Value
TypeDescription
int

PivotColumns

Columns by which the data should be pivoted - all other columns will be kept as a group column. If you want to avoid grouping, you need to remove these columns from your data before using the pivot transformation. (E.g. with the ColumnTransformation<TInput>)

Declaration
    public ICollection<PivotColumn> PivotColumns { get; set; }
Property Value
TypeDescription
ICollection<PivotColumn>

PivotValueColumns

Value columns which contain the values for the pivot columns.

Declaration
    public ICollection<PivotValueColumn> PivotValueColumns { get; set; }
Property Value
TypeDescription
ICollection<PivotValueColumn>

ProgressCount

Declaration
    public int ProgressCount { get; }
Property Value
TypeDescription
int

SourceBlock

SourceBlock from the underlying TPL.Dataflow which is used as output buffer for the component.

Declaration
    public override ISourceBlock<ExpandoObject> SourceBlock { get; }
Property Value
TypeDescription
ISourceBlock<ExpandoObject>
Overrides

TargetBlock

TargetBlock from the underlying TPL.Dataflow which is used as input buffer for the component.

Declaration
    public override ITargetBlock<TInput> TargetBlock { get; }
Property Value
TypeDescription
ITargetBlock<TInput>
Overrides

ValueAggregationFunc

If multiple values for a pivot column are found, this function is used to aggregate the values.

Declaration
    public Func<Dictionary<string, object>, object> ValueAggregationFunc { get; set; }
Property Value
TypeDescription
Func<Dictionary<string, object>, object>

Methods

CheckParameter()

Declaration
    protected override void CheckParameter()
Overrides

CleanUpOnFaulted(Exception)

Declaration
    protected override void CleanUpOnFaulted(Exception e)
Parameters
TypeNameDescription
Exceptione
Overrides

CleanUpOnSuccess()

Declaration
    protected override void CleanUpOnSuccess()
Overrides

InitComponent()

Declaration
    protected override void InitComponent()
Overrides

LinkErrorTo(IDataFlowDestination<ETLBoxError>)

If an error occurs in the component, by default the component will throw an exception and stop execution. If you use the error linking, any erroneous records will be caught and redirected.

Declaration
    public override IDataFlowSource<ETLBoxError> LinkErrorTo(IDataFlowDestination<ETLBoxError> target)
Parameters
TypeNameDescription
IDataFlowDestination<ETLBoxError>target

The target for erroneous rows.

Returns
TypeDescription
IDataFlowSource<ETLBoxError>

The linked component.

Overrides

PrepareParameterForCheck()

Declaration
    protected override void PrepareParameterForCheck()
Overrides

Reset()

Declaration
    protected override void Reset()
Overrides

Implements