Aggregator
transformation is an active transformation used to perform calculations such as
sums, averages, counts on groups of data.
The integration
service stores the data group and row data in aggregate cache. The Aggregator
Transformation provides more advantages than the SQL, you can use conditional
clauses to filter rows.
Creating an Aggregator Transformation:
Follow the below steps to create an aggregator transformation
Creating an Aggregator Transformation:
Follow the below steps to create an aggregator transformation
- Go
to the Mapping Designer, click on transformation in the toolbar ->
create.
- Select
the Aggregator transformation, enter the name and click create. Then click
Done. This will create an aggregator transformation without ports.
- To
create ports, you can either drag the ports to the aggregator transformation
or create in the ports tab of the aggregator.
Configuring the aggregator transformation:
You can configure the following components in aggregator transformation
- Aggregate
Cache: The integration service stores the group values in the index cache
and row data in the data cache.
- Aggregate
Expression: You can enter expressions in the output port or variable port.
- Group
by Port: This tells the integration service how to create groups. You can
configure input, input/output or variable ports for the group.
- Sorted
Input: This option can be used to improve the session performance. You can
use this option only when the input to the aggregator transformation in
sorted on group by ports.
Properties of Aggregator Transformation:
The below table illustrates the properties of aggregator transformation
Property
|
Description
|
Cache Directory
|
The Integration
Service creates the index and data cache files.
|
Tracing Level
|
Amount of detail
displayed in the session log for this transformation.
|
Sorted Input
|
Indicates input
data is already sorted by groups. Select this option only if the input to the
Aggregator transformation is sorted.
|
Aggregator Data
Cache Size
|
Default cache size
is 2,000,000 bytes. Data cache stores row data.
|
Aggregator Index
Cache Size
|
Default cache size
is 1,000,000 bytes. Index cache stores group by ports data
|
Transformation
Scope
|
Specifies how the
Integration Service applies the transformation logic to incoming data
|
Group By Ports:
The integration service performs aggregate calculations and produces one row for each group. If you do not specify any group by ports, the integration service returns one row for all input rows. By default, the integration service returns the last row received for each group along with the result of aggregation. By using the FIRST function, you can specify the integration service to return the first row of the group.
Aggregate Expressions:
You can create the aggregate expressions only in the Aggregator transformation. An aggregate expression can include conditional clauses and non-aggregate functions. You can use the following aggregate functions in the Aggregator transformation,
AVG
COUNT
FIRST
LAST
MAX
MEDIAN
MIN
PERCENTILE
STDDEV
SUM
VARIANCE
Examples: SUM(sales),
AVG(salary)
Nested Aggregate Functions:
You can nest one aggregate function within another aggregate function. You can either use single-level aggregate functions or multiple nested functions in an aggregate transformation. You cannot use both single-level and nested aggregate functions in an aggregator transformation. The Mapping designer marks the mapping as invalid if an aggregator transformation contains both single-level and nested aggregate functions. If you want to create both single-level and nested aggregate functions, create separate aggregate transformations.
Examples: MAX(SUM(sales))
Conditional clauses:
You can reduce the number of rows processed in the aggregation by specifying a conditional clause.
Example: SUM(salary,
slaray>1000)
This will include only the salaries which are greater than 1000 in the SUM calculation.
Non Conditional clauses:
You can also use non-aggregate functions in aggregator transformation.
Example: IIF( SUM(sales)
<20000, SUM(sales),0)
Note: By default, the Integration Service treats null values as NULL in aggregate functions. You can change this by configuring the integration service.
Incremental Aggregation:
After you create a session that includes an Aggregator transformation, you can enable the session option, Incremental Aggregation. When the Integration Service performs incremental aggregation, it passes source data through the mapping and uses historical cache data to perform aggregation calculations incrementally.
Sorted Input:
You can improve the performance of aggregator transformation by specifying the sorted input. The Integration Service assumes all the data is sorted by group and it performs aggregate calculations as it reads rows for a group. If you specify the sorted input option without actually sorting the data, then integration service fails the session
Aggregator Transformation in Informatica
ReplyDeleteinformatica online training
Useful Information :
ReplyDeleteLooking for the Best [url= Digital Marketing in Vijayawada ][/url] , We provide training on live projects, internship, Flexible Classes, Free Demo @ praiseads.com