User-Defined Mapping Outputs
A user-defined mapping output is a numeric value or a date that a mapping returns by aggregating a field or expression from each row in the mapping. Define the expression to aggregate and the data type of the result value.
Define the mapping output in the Outputs tab of the Properties view. Configure a name for the mapping output, a data type for the result, and indicate what type of aggregation to perform to return a result.
After you define the mapping output name and the output type, configure an Expression transformation in the mapping. In the Expression transformation, define the output expression that you want to aggregate. The expression can contain a port name or it can contain an expression with ports, functions, and parameters.
Outputs View
Define the mapping outputs in the Outputs view of the mapping Properties. When you define each mapping output, enter a mapping output name, the mapping output type, and the type of aggregation to perform.
The following image shows the mapping outputs in the Outputs tab of the mapping Properties view:
The Outputs view contains the following fields:
- Name
- The name of the output. Default is Output.
- Type
- The type of the mapping output. You can select a numeric type or a date/time type. Default is Integer.
- Precision
- The length of the mapping output field. Default is 10.
- Scale
- The digits to the right of the decimal in the mapping output field. Default is zero.
- Aggregation Type
You can choose one of the following types of aggregation:
- SUM
- Returns the sum of the field or expression from each input row that the Data Integration Service processed.
- MIN
- Returns the smallest numeric value or date that the Data Integration Service processed from a specific field or expression in each input row.
- MAX
- Returns the largest numeric value or date that the Data Integration Service processed from a specific field or expression in each input row.
- Binding
- The name of a mapplet or logical data object output to bind to the mapping output. This field is blank unless the mapping output is returned from a mapplet instead of from an Expression transformation in the mapping.
- Description
- The description of the mapping output.
Mapping Output Expression
Configure a mapping output expression in the Mapping Outputs view of an Expression transformation. The mapping output expression is a field or an expression to aggregate from the rows that the Expression transformation receives.
Configure an Expression transformation in the mapping and include the output expressions that you want to aggregate. The location of the Expression transformation in the pipeline might affect the mapping output results depending on whether the mapping contains filters or active transformations. You can add more than one Expression transformation to the mapping if you need to aggregate rows in different pipelines.
The following image shows the expressions in the Mapping Outputs view of the Expression transformation:
The Mapping Outputs view has the following fields:
- Outputs Name
- The name of a mapping output that you created at the mapping level. You must create the mapping output at the mapping level first. When you add the mapping output in the Expression transformation, you select the output name from a list of the outputs that you have already created.
- Expression
- The expression to aggregate for each row in the mapping. Enter a port name or enter an expression in the Expression Editor. The expression result must be numeric or a date. You can use parameters in the expression. The Data Integration Service applies the expression for each row that the Expression transformation receives. Each mapping output returns one value when the mapping completes.
Note: You do not specify the type of aggregation to perform in the Expression transformation. You indicate the field or expression that the mapping aggregates as it processes each row.