IEtlPlainDataProvider.UnpivotMode

Syntax

UnpivotMode: Boolean;

Description

The UnpivotMode property determines whether data is imported in the crosstab mode.

Comments

Crosstab is a method of data presentation, at which information about various factors is located in headers of rows and columns, and actual data is located in row and column cells.

Available values:

Example

Executing the example requires that the repository contains an ETL task with the ETL_Task identifier. The file system contains a Microsoft Excel file named Data.xlsx, the file data is presented in the crosstab mode.

Example of file

Sub UserProc;
Var
    MB: IMetabase;
    ETLTask: IEtlTask;
    ETLProvider: IEtlPlainDataProvider;
    UnpivotProvider: IDtUnpivotProvider;
    ExcelProviderEx: IDtExcelProviderEx;
    WxProvider: IWxRectangle;
    WxETLProvider: IWxETLObject;
Begin
    MB := MetabaseClass.Active;
    ETLTask := MB.ItemById("ETL_Task").Edit As IEtlTask;
     //Create a new data source
    ETLProvider := ETLTask.Create(EtlObjectType.PlainDataExcelProviderEx) As IEtlPlainDataProvider;
    ETLProvider := ETLProvider.Edit;

     //Crosstab mode
    ETLProvider.UnpivotMode := True;
     //Specify data source, from which import will be used
    ExcelProviderEx := ETLProvider.Provider As IDtExcelProviderEx;
    ExcelProviderEx.File := "c:\data.xlsx";
    ExcelProviderEx.Sheet := "Sheet1";
    ExcelProviderEx.HasHeader := False;
    ExcelProviderEx.Format := "XLSX";
     //Set up crosstab parameters
    UnpivotProvider := ETLProvider.UnpivotProvider;
    UnpivotProvider.DataBottom := 5;
    UnpivotProvider.DataWidth := 5;
    UnpivotProvider.DataRight := 11;

    UnpivotProvider.DataTop := 1;
    UnpivotProvider.HeadTop := 0;
    UnpivotProvider.HeadBottom := 0;
    UnpivotProvider.HeadColumn := -1;
    UnpivotProvider.LeftBegin := 0;
    UnpivotProvider.LeftEnd := 1;
     //Save data source
    ETLProvider.FillDefault;
    ETLProvider.Save;
     //Create a visual object
    WxProvider := EtlTask.Workspace.CreateRectangle;
    WxETLProvider := New WxETLObject.Create;

    WxETLProvider.ETLObject := EtlProvider;
    WxProvider.Style.TextPosition := WxTextPosition.Bottom;
    WxProvider.Style.PictureMarginTop := -10;
    WxProvider.PinPosition := New GxPointF.Create(5050);
    WxProvider.Extension := WxETLProvider As IWxShapeExtension;
     //Save task
    (ETLTask As IMetabaseObject).Save;
End Sub UserProc;

On executing the example a new data loader is created in the ETL task from Microsoft Excel file. Parameters required to import data in the crosstab mode are set up for the object.

See also:

IEtlPlainDataProvider