Find count Each department Number.

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
vijayasarathi7
Participant
Posts: 3
Joined: Mon Nov 25, 2013 1:37 am

Find count Each department Number.

Post by vijayasarathi7 »

Hi All,

I have a job, I want the count of the Each department number.
Source File:
DEPTNO, SAL
10, 1000
10, 1100
10, 1200
20, 1100
20, 1200
30, 1200
30, 1300
30, 1400

Target File:
Count
1
2
3
1
2
1
2
3


Thanks,
Vijayasarathi
Last edited by vijayasarathi7 on Mon Feb 03, 2014 4:26 am, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why "without using Aggregator"?

This can be done simply using key change detection techniques and stage variables, as has been discussed many times on DSXchange.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RPhani
Participant
Posts: 32
Joined: Sun Aug 26, 2012 7:03 am
Location: Hyd

Post by RPhani »

Hi,

You can get the required o/p by If -Then- Else with KeyChangeColumn(1 and 0) and StageVariables.

----------------------------
RPhani
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

I would imagine that you will also need DEPTNO in the Target File for the output to be useful.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

interview question?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply