match fields

Infosphere's Quality Product

Moderators: chulett, rschirm

Post Reply
garirt
Participant
Posts: 10
Joined: Thu Mar 31, 2005 6:37 pm

match fields

Post by garirt »

Hi,

I have the following requirement :
From a file, if any two or more records have the same value in the customer number field(NUM), but have different values in the accout number(ACC) field then store such records in another file. Problem is that, if the i/p file contains 3 records for the same NUM, and out of the 3, 2 records have same ACC, but the other one has a different one, then all the 3 records should go to the output file.
Right now, I'm able to retrieve either all the records with matching NUM & ACC or those records with matching NUM & different ACC, but not as per the requirement. can someone help me ?

Thanks,
nrc
garirt
Participant
Posts: 10
Joined: Thu Mar 31, 2005 6:37 pm

Post by garirt »

Here is one example of what to do :
ex:

i/p o/p

NUM ACC NUM ACC
1 xxx 1 xxx
1 xxx 1 xxx
2 yyy 3 aaa
2 xxx 3 aaa
3 aaa 3 bbb
3 aaa
3 bbb
JamasE
Participant
Posts: 32
Joined: Sun Aug 31, 2003 5:52 pm

Re: match fields

Post by JamasE »

garirt wrote: Right now, I'm able to retrieve either all the records with matching NUM & ACC or those records with matching NUM & different ACC, but not as per the requirement. can someone help me ?
Herm. Interesting. Off the top of my head, I would say use a Match Stage with Undup on NUM and ACC and GROUPALL of the output with the match type.
Then use a Survivorship stage to survive those groups as defined by NUM where there exists a match of type DA. (Note: not a 100% positive this can be done as don't use Survivorship phases myself.)

That way, if there are any duplicate ACCs, one of them will have a DA (and one will have an XA and there'll also be RAs if there are NUMs with no dup ACCs), and those are the groups you want to grab.

(That said, it'd probably be a lot easier to do in nearly any data manipulation package that isn't QualityStage. :) )

Cheers,
Jamas
Post Reply