To Get the First Duplicate Record from HashFile Output
Posted: Wed Jun 15, 2005 6:37 am
Hi All,
I have a Hash File Stage which has few duplicate key records going in and as HashFile Stage works, I am getting last input duplicate key record as output. Is there a way to get the first record among the duplicates as the output. I am using a sort stage and and a surrogate key to get the first one in the output but would like to know whether there is a better option using some functionality of Hashfile stage itself.
Input to Hash File
Col1(Key Field in HF) Col2 Col3
100 ABC C99
100 RXZ G77
100 JKL G77
115 XYZ R33
Normal Output
Col1(Key Field in HF) Col2 Col3
100 JKL G77
115 XYZ R33
Required Output
Col1(Key Field in HF) Col2 Col3
100 ABC C99
115 XYZ R33
Thanks in Advance,
Tom.
I have a Hash File Stage which has few duplicate key records going in and as HashFile Stage works, I am getting last input duplicate key record as output. Is there a way to get the first record among the duplicates as the output. I am using a sort stage and and a surrogate key to get the first one in the output but would like to know whether there is a better option using some functionality of Hashfile stage itself.
Input to Hash File
Col1(Key Field in HF) Col2 Col3
100 ABC C99
100 RXZ G77
100 JKL G77
115 XYZ R33
Normal Output
Col1(Key Field in HF) Col2 Col3
100 JKL G77
115 XYZ R33
Required Output
Col1(Key Field in HF) Col2 Col3
100 ABC C99
115 XYZ R33
Thanks in Advance,
Tom.