官术网_书友最值得收藏!

Aggregator transformation

Aggregator transformation is used for calculations using aggregate functions on a column as against in expression transformation, which is used for row-wise manipulation.

You can use aggregate functions such as SUM, AVG, MAX, MIN in aggregator transformation.

Scenario for aggregator transformation: Use the EMPLOYEE oracle table as the source, and get the sum of salaries of all the employees in the target.

Perform the following steps to achieve the functionality:

  1. Import the source using the Employee Oracle table in the Source Analyzer, and create Target TGT_TOTAL_SALARY in Target Designer.
  2. Create mapping m_AGG_TOTAL_SALARY, and drag the source and target from the Navigator to Workspace. Create the aggregator transformation with the name AGG_TOTAL_SAL.
  3. As we need to calculate TOTAL_SALARY, drag only the SALARY column from the Source Qualifier to aggregator transformation, as shown here:
  4. Add a new column TOTAL_SALARY in the aggregator transformation to calculate the total salary as shown in the following screenshot:
  1. Add the function in the TOTAL_SALARY port by opening the expression editor as described in the preceding section. The function we need to add to get the total salary is SUM(JAN_SAL):
  2. Connect the TOTAL_SALARY port to the target as shown in the following screenshot:

With this, we are done using the aggregator transformation. When you use aggregator transformation, integration services store the data temporarily in cache memory. Cache memory is created because the data flows in a row-wise manner in Informatica, and the calculations required in aggregator transformation are column wise. Unless we store the data temporarily in cache, we cannot calculate the result. In the preceding scenario, the cache starts storing the data as soon as the first record flows into the aggregator transformation. Cache will be discussed in detail later in the chapter under the Lookup transformation section.

In the next section, we will talk about added features of aggregator transformation. Aggregator transformation comes with features such as group by and sorted input.

主站蜘蛛池模板: 离岛区| 淳安县| 隆化县| 枣强县| 邵武市| 化隆| 丁青县| 丽江市| 日喀则市| 高清| 衡山县| 江川县| 胶州市| 吉安市| 吉木萨尔县| 洪湖市| 溧水县| 平谷区| 莱芜市| 芜湖市| 壤塘县| 兴和县| 腾冲县| 深水埗区| 阿荣旗| 安庆市| 怀化市| 金寨县| 丁青县| 津南区| 新源县| 临沧市| 泸水县| 昌宁县| 孝昌县| 哈尔滨市| 盘山县| 西林县| 琼海市| 淳安县| 赤水市|