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
Counters
Moderators: chulett, rschirm, roy
Re: Counters
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.
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)
Senior Project Leader - BI Specialist (DataStage/J2EE)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.