Hi All,
My requirement is
source is oci and looks
empno ename dept sal
1 A 1 5
2 B 1 10
3 C 2 10
4 D 3 5
5 E 2 10
I need to get total sal by grouping dept using aggregator and my data should look like
empno ename dept sal
1 A 1 15
2 B 1 15
3 C 2 20
4 D 3 5
5 E 2 20
Any suggestions please
Thanks in advance
Saik.
Aggregator stage
Moderators: chulett, rschirm, roy
Re: Aggregator stage
In this case, DEPT will be the key, for which the Salaray accumulation needs to be done. So the output of Aggregator can only be DEPT / SALARY-TOTAL. You may need a Lookup with this file for the pattern you may need. Hope this helps.rafidwh wrote:Hi All,
My requirement is
source is oci and looks
empno ename dept sal
1 A 1 5
2 B 1 10
3 C 2 10
4 D 3 5
5 E 2 10
I need to get total sal by grouping dept using aggregator and my data should look like
empno ename dept sal
1 A 1 15
2 B 1 15
3 C 2 20
4 D 3 5
5 E 2 20
Any suggestions please
Thanks in advance
Saik.
Group by the third column, do a sum on the salary by either using an aggregator stage or you do this even in the sql select. Let this go into a hashed file keyed on dept.
You source will be the exact same source, do a lookup on your hashed file that contains aggregated data to get the nature of your output.
You source will be the exact same source, do a lookup on your hashed file that contains aggregated data to get the nature of your output.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
You can use your user defined select query as
Code: Select all
select a.empno, a.ename , a.dept , (select sum(b.sal) from tablename b where a.dept = b.dept group by b.dept) As SAL from tablename a
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'