0% found this document useful (0 votes)
10 views6 pages

Input: Output: Order Id Seq Num Order Id

The document describes transforming input data into two output targets. The input data contains department IDs, employee IDs, and salaries. It is first sorted by department ID and aggregated to find the maximum and minimum salary for each department. The data is then joined back to the original and routed such that the first target contains the highest paid employee per department and the second target contains the lowest paid employee per department.

Uploaded by

SQL INFORMATICA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views6 pages

Input: Output: Order Id Seq Num Order Id

The document describes transforming input data into two output targets. The input data contains department IDs, employee IDs, and salaries. It is first sorted by department ID and aggregated to find the maximum and minimum salary for each department. The data is then joined back to the original and routed such that the first target contains the highest paid employee per department and the second target contains the lowest paid employee per department.

Uploaded by

SQL INFORMATICA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Create a Sequence Number using Expression for the below input dataset in a source

file.

Input: Output:
Order Id Seq Num Order Id
10 1 10
10 2 10
10 3 10
20 4 20
20 5 20
20 6 20

Source ->' Expression ->' Target


Input / Output Input Variable Output Input Input
Order Id Order Id Var = Var + 1Out_Seq = Var Seq Num Order Id
10 10 1 1 1 10
10 10 2 2 2 10
10 10 3 3 3 10
20 20 4 4 4 20
20 20 5 5 5 20
20 20 6 6 6 20

Note: The initial value of Var Variable


port is 0
There are two columns in the Input dataset of a source file. The dataset needs to be transformed as per the Output dataset:

Input: Output:
Order_Id Proc_Id Order_Id Proc_Id
10 111 10 111,222,333
10 222 20 444,555
10 333 30 666,777,888,999
20 444
20 555
30 666
30 777
30 888
30 999

Expression Logic:
V_Current_Order_Id =
Order_Id
V_List_Proc_Id: IIf( V_Current_Order_Id = V_Previous_Order_Id, V_List_Proc_Id||','|| Proc_Id, Proc_Id)
V_Previous_Order_Id = V_Current_Order_Id
Out_Proc_Id = V_List_Proc_Id

Source -> Expression (Using variables create the rows with concatenated Proc_Ids for each Order_Id) -> Aggregator (Group By
last row for each Order_Id which contains the required concatenated Proc_Ids)
as per the Output dataset:

Expression
V_Previous_Order_Id Order_Id Proc_Id V_Current_Order_Id V_List_Proc_Id
10 111 10 111
10 10 222 10 111,222
10 10 333 10 111,222,333
10 20 444 20 444
20 20 555 20 444,555
20 30 666 30 666
30 30 777 30 666,777
30 30 888 30 666,777,888
30 30 999 30 666,777,888,999

_Id) -> Aggregator (Group By on the Order_Id column without using any aggregate function to get the
V_Previous_Order_Id Out_Proc_Id
10 111
10 111,222
10 111,222,333
20 444
20 444,555
30 666
30 666,777
30 666,777,888
30 666,777,888,999
As per the below Source data, create two target files. The first target will contain the highest salaried
employee of each department and the second target will contain the lowest salaried employee of
each dept.

Input: Aggregator
Dept Id Emp Id Salary Dept Id MaxSal Min Sal
200 40 40000 100 75000 20000
300 20 30000 200 60000 40000
200 70 50000 300 45000 30000
100 60 20000
300 50 35000
100 30 70000
200 10 60000
300 80 45000
100 90 75000

Output1:
Dept Id Emp Id Highest Salary
100 90 75000
200 10 60000
300 80 45000

Output2:
Dept Id Emp Id Lowest Salary
100 60 20000
200 40 40000
300 20 30000

Source -> Sorter (Sort on Dept Id) -> Aggregator (Group on Dept Id and Calculate the Max and Min Salary for each Department
on Dept Id ) -> Router (One Group will contain the rows where Max Salary = Salary and another group will contain the rows wh
seperate targets. The first target will contain the highest salaried employee of each department and the second target will con
->' Joiner
Dept Id Emp Id Salary MaxSal Min Sal
100 60 20000 75000 20000
100 30 70000 75000 20000
100 90 75000 75000 20000
200 40 40000 60000 40000
200 70 50000 60000 40000
200 10 60000 60000 40000
300 20 30000 45000 30000
300 50 35000 45000 30000
300 80 45000 45000 30000

alary for each Department) - > Joiner (Join the original data with the output of Aggregator
up will contain the rows where Min Salary = Salary) -> Populate these groups into two
the second target will contain the lowest salaried employee of each dept.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy