I have to find the sum of salaries of all employees and this sum should repeat for all the rows.
The output should look like as
i/p:
employee_id, salary
-------------------------------
10, 1000
20, 2000
30, 3000
40, 5000
o/p
employee_id, salary, salary_sum
-------------------------------
10, 1000, 11000
20, 2000, 11000
30, 3000, 11000
40, 5000, 11000
I am able to achieve the o/p with the help of job sequence by using two jobs after writing
into intermediate file.Just want to know is there any way to get required o/p with one parallel
job?
Looking for effective solution for sum
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
1. IF your source is a database handle this in the SQL by generating the sum and joining back to your main source on a ever true condition (1=1)
2. Non Database: you may follow a traditional fork join meathod of taking a copy and then aggregator and then joinin back to second output of copy.
3. If you are using 8.5 you may optionally use looping of transformer (at your risk as you need to store all records in cache and may run out of memory when volume is huge)
2. Non Database: you may follow a traditional fork join meathod of taking a copy and then aggregator and then joinin back to second output of copy.
3. If you are using 8.5 you may optionally use looping of transformer (at your risk as you need to store all records in cache and may run out of memory when volume is huge)
- Zulfi
-
- Participant
- Posts: 152
- Joined: Mon Mar 07, 2011 6:16 am
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
-
- Participant
- Posts: 152
- Joined: Mon Mar 07, 2011 6:16 am