Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

Aggregate Transformation in SSIS Advanced Mode

The Aggregate Transformation in SSIS supports multiple outputs. It means Aggregate Transformation can read the data from the source for once. And then, we can create various outputs, and each output may have a different set of aggregations. Here, we show you how to configure multiple outputs in aggregate transformation in SSIS advanced mode with example

TIP: Please refer to Aggregate Transformation in SSIS article to understand the Aggregations and its functionalities.

Aggregate Transformation in SSIS Advanced Mode example

STEP 1: Open BIDS and Drag and drop the data flow task from the toolbox to control flow and rename it as Aggregate Transformation.

Aggregate Transformation in SSIS Advanced Mode 1

STEP 2: Drag and drop OLE DB Source, Aggregate Transformation from the toolbox to the SSIS data flow region

Aggregate Transformation in SSIS Advanced Mode 2

Double click on OLE DB source in the data flow region will open the connection manager settings and provides space to write our SQL statement. Here we are using DimGeography and [FactResellerSales] present in the AdventureworkDW2014

Aggregate Transformation in SSIS Advanced Mode 3

The SQL command we used in the above screenshot to retrieve data is:

SELECT [EnglishCountryRegionName]
      ,[StateProvinceName]
      ,[City]
      ,[PostalCode]
      ,RESELLER.[UnitPrice]
      ,RESELLER.[ProductStandardCost]
      ,RESELLER.[TotalProductCost]
      ,RESELLER.[SalesAmount]
      ,RESELLER.[TaxAmt]  
FROM [DimGeography]
  INNER JOIN 
     [FactResellerSales] AS RESELLER ON
 [DimGeography].[SalesTerritoryKey] = RESELLER.[SalesTerritoryKey]

STEP 4: Click on columns tab to verify the columns. In this tab we can uncheck the unwanted columns also.

Aggregate Transformation in SSIS Advanced Mode 4

STEP 5: Double-click on the Aggregate transformation to open the Aggregate Transformation editor. In the upper pane, we have a button to toggle between Basic and Advanced Mode. In this example, we want to configure multiple outputs, so select the Advance mode.

Once you click on the Advanced mode button, a new pane will be opened to configure multiple outputs.

  • Aggregate Name: Specify the aggregate name.
  • Group By Columns: Here, it shows the list of columns we used for grouping.

Next, in the lower pane, we select the required columns to perform Aggregate Transformation operations by checking them in Available Input Columns.

Once you check the required columns, then those column names will appear in the Input Column located in the lower pane, as shown in the below figure

Aggregate Transformation in SSIS Advanced Mode 5

From the above screenshot, you can observe that we were assigning Aggregation name as COUNTRY NAME and Group by as EnglishCountryRegionName.

Let us add one more aggregation and assigning name as STATE NAME and Group by as EnglishCountryRegionName, StateProvinceName.

Aggregate Transformation in SSIS Advanced Mode 6

From the above screenshot, we are calculating the Sum of Unit Price, Sum of Product Standard Cost, Average of Total Product Cost, Minimum of Sales Amount, and Maximum of Tax Amount. And Group by English Country Region then by State Province Name.

Let us add one more aggregation and assigning name as CITY and Group by as EnglishCountryRegionName, StateProvinceName, City.

Aggregate transformation in SSIS Advanced Mode 7

From the above, we are calculating the Sum of Unit Price, Average of Product Standard Cost, Minimum of Total Product Cost, Maximum of Sales Amount, and Sum of Tax Amount. And Group by English Country Region Then by State Province Name and Then by City.

STEP 6: Drag and drop 3 OLE DB destinations from the toolbox to the data flow region to configure the three output we get from Aggregate transformation.

Aggregate transformation in SSIS Advanced Mode 8

From the above, we renamed the OLEDB destinations to Group By Country, Group By State and Group By City

STEP 7: When you drag the Aggregate transformation output arrow to OLE DB destination an Input Output Selection window will open to select one of the output and here we are selecting COUNTRY NAME

Aggregate transformation in SSIS Advanced Mode 9

Let us assign State name output to second OLE DB destination

Aggregate transformation in SSIS Advanced Mode 10

We have one more output (CITY) left so, when we drag the green arrow from aggregate transformation to 3rd OLE DB Destination, it automatically assigns to City.

Aggregate transformation in SSIS Advanced Mode 11

STEP 8: Now, we have to configure the OLE DB destination for the country name. So double click on the OLE DB Destination and provide the required information.

Aggregate transformation in SSIS Advanced Mode 12

Here we are selecting [SSIS Tutorials] database as destination database and [Group By Country] table as the destination table

STEP 9: Click on the Mappings tab to check whether the aggregate source columns exactly mapped to the destination columns.

Aggregate transformation in SSIS Advanced Mode 13

STEP 10: Now, we have to configure the OLE DB destination for the group by state aggregation output. So double click on the OLE DB Destination and provide the required information

Aggregate transformation in SSIS Advanced Mode 14

Here we are selecting [SSIS Tutorials] database as destination database and [Group By State] table as the destination table

Repeat Step 9

STEP 12: Now, we have to configure the OLE DB destination for the city output rows. So double click on the OLE DB Destination and provide the required information

Aggregate transformation in SSIS Advanced Mode 15

Here we are selecting the [Group By City] table as destination table

Repeat Step 9

Click ok to finish our package design. Let us run the package

Aggregate transformation in SSIS Advanced Mode 16

Let us see the result of Group By English Country Region Name. For this, open the SQL Server Management studio and write the below query

SELECT [EnglishCountryRegionName]
      ,[UnitPrice]
      ,[ProductStandardCost]
      ,[TotalProductCost]
      ,[SalesAmount]
      ,[TaxAmt]
  FROM [SSIS Tutorials].[dbo].[GROUP BY COUNTRY]

OUTPUT

Aggregate transformation in SSIS Advanced Mode 17

Now, see the result of Group By English Country Region Name, State Province Name

SELECT [EnglishCountryRegionName]
      ,[StateProvinceName]
      ,[UnitPrice]
      ,[ProductStandardCost]
      ,[TotalProductCost]
      ,[SalesAmount]
      ,[TaxAmt]
  FROM [SSIS Tutorials].[dbo].[GROUP BY STATE]

OUTPUT

Aggregate transformation in SSIS Advanced Mode 18

Let us see the result of Group By English Country Region Name, State Province Name and City

SELECT [EnglishCountryRegionName]
      ,[StateProvinceName]
      ,[City]
      ,[UnitPrice]
      ,[ProductStandardCost]
      ,[TotalProductCost]
      ,[SalesAmount]
      ,[TaxAmt]
  FROM [SSIS Tutorials].[dbo].[GROUP BY CITY]
Aggregate transformation in SSIS Advanced Mode 19

Filed Under: SSIS

  • What is SSIS
  • Install SQL Server Data Tools
  • Create a SSIS Project
  • Create SSIS Package
  • SSIS Connection Manager
  • OLE DB Connection Manager
  • SSIS ADO Connection Manager
  • ADO.NET Connection Manager
  • SSIS Cache Connection Manager
  • SSIS Excel Connection Manager
  • SSIS File Connection Manager
  • SSIS FTP Connection Manager
  • SSIS SMO Connection Manager
  • Source Assistance in SSIS
  • Flat File Source in SSIS
  • OLE DB Source in SSIS
  • Excel Source in SSIS
  • ADO.NET Source in SSIS
  • SSIS FLAT FILE Destination
  • SSIS OLE DB Destination
  • SSIS ADO.NET Destination
  • SSIS Transformations
  • SSIS Audit Transformation
  • SSIS Aggregate Transformation
  • SSIS Aggregate Advanced Mode
  • SSIS Cache Transformation
  • SSIS Character Map
  • SSIS Conditional Split
  • SSIS Copy Column
  • SSIS Data Conversion
  • SSIS Derived Column
  • SSIS Export Column
  • SSIS Fuzzy Grouping
  • SSIS Fuzzy Lookup
  • SSIS Import Column
  • SSIS Lookup Introduction
  • Lookup – OLE DB Connection
  • SSIS Lookup in Full Cache Mode
  • SSIS Lookup – Case Sensitivity
  • SSIS Merge Transformation
  • SSIS Merge Join Transformation
  • SSIS Merge Join – Left Outer Join
  • SSIS Merge – Right Outer Join
  • SSIS Merge Join – Full Outer Join
  • SSIS Multicast Transformation
  • SSIS OLEDB Command
  • OLEDB Command – Delete Data
  • OLEDB Command-Update Data
  • SSIS Percentage Sampling
  • SSIS Pivot Transformation 2008
  • SSIS Pivot Transformation
  • SSIS Row Count Transformation
  • SSIS Row Sampling
  • Script Component as Source
  • Script Component as Destination
  • SSIS Script as Transformation
  • SSIS Sort Transformation
  • SSIS SCD Type 0
  • SSIS SCD Type 1
  • SSIS SCD Type 2
  • SSIS Term Lookup
  • SSIS Term Extraction Intro
  • Term Extraction – Extract Nouns
  • SSIS Extract Noun Phrases
  • Extract Nouns & Noun Phrases
  • Term Extraction – Exclusion Tab
  • SSIS Unpivot Transformation
  • SSIS Union All Transformation
  • SSIS For Loop Container
  • SSIS ForEach File Enumerator
  • SSIS ForEach SMO Enumerator
  • SSIS ForEach Variable
  • SSIS Foreach NodeList
  • Foreach ADO.NET Schema Rowset Enumerator
  • SSIS Bulk Insert Task
  • SSIS Data Profiling Task
  • Execute T-SQL Statement Task
  • SSIS Execute SQL Task Intro
  • SSIS Execute SQL Task Example
  • Execute SQL Task- Single Rowset
  • Execute SQL Task – Full Row Set
  • SSIS Execute Package Task
  • Execute Packages in SQL Server
  • Execute Packages in File System
  • SSIS Execute Package Project Reference
  • SSIS File System Task
  • SSIS File System Task- Copy Files
  • File System Task-Copy Directory
  • File System Task – Delete Files
  • File System Task – Delete Folder
  • File System Task -Move Directory
  • SSIS File System Task -Move File
  • File System – Move Multiple files
  • File System Task – Rename File
  • File System Task – Set Attributes
  • SSIS FTP TASK
  • SSIS Create Local Directory
  • SSIS Create Remote Directory
  • SSIS FTP Task Send Files
  • SSIS FTP – Send Multiple Files
  • SSIS FTP Task Delete Local Files
  • FTP TASK Delete Local Directory
  • FTP Task Delete Remote files
  • SSIS Delete Remote Directory
  • SSIS FTP Task Receive Files
  • SSIS FTP Receive Multiple Files
  • SSIS Script Task
  • Transfer SQL Server Objects Task
  • Transfer SQL Table Structures
  • Transfer SQL Tables with Data
  • Transfer SQL Stored Procedures
  • Transfer User Defined Functions
  • Transfer SQL Views in SSIS
  • SSIS Web Service Task
  • SSIS XML Task-Validate XML File
  • Transform XML File using XSLT
  • XML Task-XML files Differences
  • Create SSIS Catalog
  • Package Deployment using BIDS
  • Deploy Package Using SQL
  • Deploy using SQL Server Wizard
  • SSIS Breakpoints
  • SSIS Checkpoints
  • SSIS Error Handling
  • SSIS Event Handlers
  • SSIS Transactions
  • SSIS Logging
  • SSIS Parameters
  • SSIS Package Configuration
  • Configure using SQL Server
  • Config using Registry Entry
  • Conf with Environment Variable
  • SSIS XML Configuration File
  • XML Configuration File Part 2
  • SSIS Package Protection Level
  • SSIS Incremental Load
  • Incremental Load Example 2
  • SSIS Remove Double Quotes

Copyright © 2021· All Rights Reserved by Suresh.
About | Contact | Privacy Policy