Sort your data so that the combination of F1/F2 values that trigger a drop will appear in the first record for a given value of keycolumn. In a transformer after the sort, keep track of key changes. When the key changes, examine F1 & F2 for the the drop condition and set a stage variable flag accordingly. Use a constraint to keep or drop records based on the flag.
Regards,
Need to drop records
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 152
- Joined: Mon Mar 07, 2011 6:16 am
No, that will not meet the requirements he has specified. He needs to completely remove only the keys which have at least one record where f1 and f2 are both equal to 'N'. All other keys will be left alone (no drops when 'N' and 'N' doesn't exist for a key).
Regards,
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 26
- Joined: Thu Aug 12, 2010 12:07 am
1. Process your source data into two flows(mainflow and change flow) from transformer stage
2. add dummy=1 in tranformer for changed flow
3.put sort stage in changed flow by sorting on the 3 columns(key,f1 and f2)
4.put filter using the condition f1=f2=N, then the output of this stage will be having the key's with both f1 and f2=N
5. Use Left outer join between main flow and changed flow, output of this join will be 3 columns from main flow and dummy column from changedflow
6.Use transformer and add conditon as dummy<>1 and send the output to target
2. add dummy=1 in tranformer for changed flow
3.put sort stage in changed flow by sorting on the 3 columns(key,f1 and f2)
4.put filter using the condition f1=f2=N, then the output of this stage will be having the key's with both f1 and f2=N
5. Use Left outer join between main flow and changed flow, output of this join will be 3 columns from main flow and dummy column from changedflow
6.Use transformer and add conditon as dummy<>1 and send the output to target
-
- Participant
- Posts: 14
- Joined: Thu Jul 10, 2008 7:37 am
- Location: mumbai
Re: Need to drop records
Step 1:
Usea filter stage apply condition f1 = N and f2= N
you will get all key columns having both non key columns value N.
Step 2:
use look up stage with step1 out put as reference. join on the Key column
use reject link for lokkup failure.
the data in Reject file will be your desired output.
Usea filter stage apply condition f1 = N and f2= N
you will get all key columns having both non key columns value N.
Step 2:
use look up stage with step1 out put as reference. join on the Key column
use reject link for lokkup failure.
the data in Reject file will be your desired output.