Description:
This step calculates and summarizes the numeric data using the Pivot function.
Inputs
- pivotRows – select pivot rows
- column - select column
- pivotColumns - select pivot columns
- operation - select pivot operation
- outColumn - provide output column name
- pivotValues - select pivot value
- showRowGrandTotal - show row grand total
- showColumnGrandTotal - show column grand total
Returns
- None
Usage:
Prerequisite:
ETL process engine service should be running to execute the ETL definitions.
Example:
Let’s build and execute the “clsPivotTransformDef” example.
- Create a new definition called “clsPivotTransformDef”
- Select the definition and click the “design” button
- Drag “clsInputCSV, clsPivotTransform, and clsOutputCSV” step from the toolbox
- Connect the dots between the Start and other steps as above
- Define variables/globals required for the execution
- Click the "clsInputCSV" step to configure its "Required" properties. Provide a name to the step. Provide the input CSV file path on the application server. Select the ETL data schema from the drop-down list. Note: The column names in the schema should match the columns in the input file. Click the Save button.
- Click the "clsInputCSV" step to configure its "Optional" properties. Click the button to view the schema for understanding.
- Click the "clsPivotTransform" step to configure its "Required" properties. Provide the step name. Click the button to configure the Pivot Columns. Click the Save button.
- Click the button to configure the Pivot Columns. Click the Add Row (+) button to insert an empty row. Select the column name from the drop-down list. Click the Save button. Click the Add Row button to insert multiple pivot columns for transform.
- Click the button to configure the Pivot Values. Click the Add Row (+) button to insert an empty row. Select the column name from the drop-down list. Select the pivot operation from the drop-down list below. Click the Save button. Click the Add Row button to insert multiple pivot values for transform.
- Click the "clsPivotTransform" step to configure its "Optional" properties. Click the button to select Pivot Rows. Click the Add Row (+) button to insert an empty row. Select the column name from the drop-down list. Click the Save button. Click the Add Row button to insert multiple pivot rows for transform. Select “Yes” to include the grand total computation for the row and column.
- The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.
- Click the "clsOutputCSV" step to configure its "Required" properties. Provide a name to the step. Provide the output CSV file path on the application server. Click the Save button.
- Click the "clsOutputCSV" step to configure its "Optional" properties. Provide a name to the step. Provide the variable/global reference to hold the virtual output path. Click the Save button.
- Save the ETL definition, create a new ETL instance, and execute. Render the ETL instance. The “clsPivotTransform” step should calculate and summarize the numeric data using the Pivot function. The variable/global holds the output file virtual path as below.
- The ETL transform pivot output file is included here for reference.
- A similar pivot function output from Excel is included here for reference.
Definition Sample:
You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright ETL Process Definition (XML file) page.
NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.