Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Aggregation transformation component in SSIS

$
0
0

This is the scenario faced by a candidate when he had repeated values in his SQL Server records as shown in the image down below.


Aggregation transformation component in SSIS

If we try to run the package it will throw us an error,

Error:
Aggregation transformation component in SSIS
Aggregation transformation component in SSIS

The error says that the pivot key has a duplicate value.

Solution:

To solve this error we will add a new component on our SSIS package available from SSIS toolbox under transformationknown as Aggregation Transformation. With the use of this component duplicate values will be removedand it will become one while Sales Amount gets aggregated.


Aggregation transformation component in SSIS

This new Aggregate component is asked by candidate of MSBI training to place it between “OLE DB Source” and “Sort” component.


Aggregation transformation component in SSIS

To remove redcross mark seen over “Aggregate” component even after connecting data path to each component. Double click and open its editor window to configure it.


Aggregation transformation component in SSIS

After Editor window is open set “SalesAmount” operation field to “Sum” as shown in the image down below.


Aggregation transformation component in SSIS

After configuring the Aggregate transformation, we then execute the package,


Aggregation transformation component in SSIS

The output shown below is from the laptop of MSBI training candidate where duplicate values for “Jan” and “Sun” has their “Sales Amount” field aggregated.


Aggregation transformation component in SSIS

Viewing all articles
Browse latest Browse all 3160

Trending Articles