Hi Ray
Can you please let me know how to implement this logic in server job or in the source sql query
Input :
Account id Flag
123 Y
123 Y
124 Y
124 N
125 N
125 N
Output :
Account id Flag
123 Y
124 Y
125 N
In the source,
If there is flag as 'Y' for any of the one record with the same account id ,we should have target also as 'Y' only,
If there is 'Y' for one record and 'N' for another record with same Account id ,we should have 'Y in the target.
If the flag from the source for all the records as 'N',then only we should have target as 'N'
In target Account id is unique...
Thanks
Kiran
logic implementation
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 110
- Joined: Mon Jan 11, 2010 4:22 am
logic implementation
Last edited by kirankumarreddydesireddy on Mon Mar 28, 2011 2:15 am, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Why don't YOU try it first? We're not really here to solve your problems, we're here to help you with them.
And why did you choose to post a server question in the Enterprise Edition forum?
And why did you choose to post a server question in the Enterprise Edition forum?
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.
Simple to do in a transformer.
Sort the input on the key and the flag, so that the Y's are always before the N's for each key.
Then use a Stage Variable to check if it is a new Key, you would need to store the old Key value in another Stage Variable to do the check
If it is a new Key, check the flag; if it is a Y it will be a Y for all values of the Key and if it is a N it will also be a N for all values of that Key
Sort the input on the key and the flag, so that the Y's are always before the N's for each key.
Then use a Stage Variable to check if it is a new Key, you would need to store the old Key value in another Stage Variable to do the check
If it is a new Key, check the flag; if it is a Y it will be a Y for all values of the Key and if it is a N it will also be a N for all values of that Key
Modern Life is Rubbish - Blur
-
- Participant
- Posts: 110
- Joined: Mon Jan 11, 2010 4:22 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: