Aggregator state --count on two columns

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
hsahay
Premium Member
Premium Member
Posts: 175
Joined: Wed Mar 21, 2007 9:35 am

Aggregator state --count on two columns

Post by hsahay »

Hi ,

please help me how to achive this using Aggregator state

CLAIM_ID CLAIM_LINE_ID
1000 1
2000 1
2000 2

I need to get COUNT(DISTINCT CLAIM_ID) AND COUNT(CLAIM_LINE_ID) using Aggregator state

CLAIM_ID_COUNT CLAIM_LINE_ID_COUNT
2 3


Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Add an artificial grouping column that has a constant value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hsahay
Premium Member
Premium Member
Posts: 175
Joined: Wed Mar 21, 2007 9:35 am

Post by hsahay »

thansk Ray for the replay..i Need more clarification (what are all stages and functions i need to use )

need apply aggregration on 3 columns.

Group_id is same for all rows...need distinct count of CLAIM_ID, count of CLAIM_LINE_ID and sum of amount

here is smaple data
GROUP_ID CLAIM_ID CLAIM_LINE_ID AMOUNT
1 1000 1 10
1 2000 1 20
1 2000 2 10


OUTPUT REQUIRED

GROUP_ID CLAIM_ID_COUNT CLAIM_LINE_ID_COUNT TOTAL AMOUNT
1 2 3 40



Thanks in adavnce
Post Reply