Counters

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
Nicole
Premium Member
Premium Member
Posts: 93
Joined: Mon Oct 22, 2007 12:55 pm
Location: Albany
Contact:

Counters

Post by Nicole »

Hi there...

I want to subtract the value of 2 columns and if they are below a certain amount, then I want to add 1 to a counter. What is the best way to do this?

Should I create a count output column and in the derivation put the criteria in an IF statement?

I looked in the forum for counter examples or questions but didn't see THAT much out there.

Thank you in advance for your help.

Nicole
pratimdc
Premium Member
Premium Member
Posts: 9
Joined: Mon Mar 19, 2007 9:50 am

Re: Counters

Post by pratimdc »

If I have understood your requirement, then may be this will help -
1. Suppose the columns under consideration as C1 and C2
2. Use Column Generator or Transformer to generate a new column C3.
3. Then make C3 = C2 - C1
4. Use Filter stage to apply filter on C3, pertaining to your value.
5. Use Aggregator stage to count the number of rows.

You will have thus the count.
Pratim Chaudhuri
Senior Project Leader - BI Specialist (DataStage/J2EE)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

U (one of our posters) did not ask the question.

The second personal pronoun in the nominative case in English is spelled "you", not "u". Please strive for a professional standard of written English 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.
Post Reply