tPivotToColumnsDelimited
Fine-tunes the selection of data to output.
The tPivotToColumnsDelimited outputs
data based on an aggregation operation carried out on a pivot column.
tPivotToColumnsDelimited Standard properties
These properties are used to configure tPivotToColumnsDelimited running in the Standard Job framework.
The Standard
tPivotToColumnsDelimited component belongs to the File family.
The component in this framework is available in all Talend
products.
Basic settings
Pivot column |
Select the column from the incoming flow that will be used as |
Aggregation column |
Select the column from the incoming flow that contains the data to |
Aggregation function |
Select the function to be used in case several values are |
Group by |
Define the aggregation sets, the values of which will be used for |
 |
Input Column: Match the input |
File Name |
Name or path to the file to be processed and/or the variable to be For further information about how to define and use a variable in |
Field separator |
Character, string or regular expression to separate fields of the |
Row separator |
String (ex: ” |
Global Variables
Global Variables |
NB_LINE: the number of rows read by an input component or
NB_LINE_OUT: the number of rows written to the file by
ERROR_MESSAGE: the error message generated by the A Flow variable functions during the execution of a component while an After variable To fill up a field or expression with a variable, press Ctrl + For further information about variables, see |
Usage
Usage rule |
This component requires an input flow. |
Limitation |
Due to license incompatibility, one or more JARs required to use |
Using a pivot column to aggregate data
The following scenario describes a Job that aggregates data from a delimited input
file, using a defined pivot column.
Dropping and linking components
- Drop the following component from the Palette to the design workspace: tFileInputDelimited, tPivotToColumnsDelimited.
-
Link the two components using a Row >
Main connection.
Configuring the components
Set the input component
-
Double-click the tFileInputDelimited
component to open its Basic settings
view. -
Browse to the input file to fill out the File
Name field.The file to use as input file is made of 3 columns, including:
ID, Question and the
corresponding Answer -
Define the Row and Field separators, in this example, respectively: carriage
return and semi-colon - As the file contains a header line, define it also.
-
Set the schema describing the three columns: ID,
Questions, Answers.
Set the output component
-
Double-click the tPivotToColumnsDelimited
component to open its Basic settings
view. -
In the Pivot column field, select the
pivot column from the input schema. this is often the column presenting most
duplicates (pivot aggregation values). -
In the Aggregation column field, select
the column from the input schema that should gets aggregated. -
In the Aggregation function field, select
the function to be used in case duplicates are found out. -
In the Group by table, add an Input
column, that will be used to group by the aggregation column. -
In the File Name field, browse to the
output file path. And on the Row and
Field separator fields, set the
separators for the aggregated output rows and data.
Saving and executing the Job
- Press Ctrl+S to save your Job.
-
Press F6 or click Run on the Run tab to
execute the Job.The output file shows the newly aggregated data.