Regarding aggregator stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Saama
Premium Member
Premium Member
Posts: 83
Joined: Wed Nov 22, 2006 6:42 pm
Location: Pune
Contact:

Regarding aggregator stage

Post by Saama »

hi,
iam using aggregator stage inorder to do sum .
i want to calculate the sum of the salaries of the employers.
in aggregator stage i/p stage i didn't do any changes.
in the o/p stage, salary column- i derived as SUM(SALARY),i have GROUPED EVERY I/P COLUMN.
it doesn't show the sum, infact it just dumps data from source to target.
it doesn't perform any aggregation functions. am i missing something.shall i manually generate a extra column called sum in the source o/p data.
plz assist me.
cheers;
saama
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Actually, it *is* performing aggregation functions. The problem is the fact that you are grouping on 'every input column' which sounds like it is making every record a separate group and so a singleton sum.

You can't pass any 'extra' columns to the Aggregator, only the ones actually involved in the aggregation. In this case, send in the Salary field and just whatever other field or fields want you want a sum of salaries for. It that's just per 'employer' then just send that field in with the salary field, group by employer and sum salary.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Saama
Premium Member
Premium Member
Posts: 83
Joined: Wed Nov 22, 2006 6:42 pm
Location: Pune
Contact:

Post by Saama »

Hi gurus,
thanks very much.

cheers;
saama
Sakthi_Sst
Participant
Posts: 36
Joined: Wed Aug 09, 2006 12:18 am
Location: Chennai

Post by Sakthi_Sst »

Hi Saama,

Either you can group or sum,
For eg :if you have 3 colums out of which you need to calculate sum for 1 column the remaning 2 should be grouped and not all the 3 col's.
Sakthi
Post Reply