Input: Output: Order Id Seq Num Order Id
Input: Output: Order Id Seq Num Order Id
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
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.