Joining to Hashed File using "like" or "conta
Posted: Wed Nov 04, 2009 8:31 pm
I've got a Transformer stage that has an incoming Sequential file and an incoming Hashed file.
For instance, let's suppose my Sequential File has the following data:
Product|Quantity
AA1234|10
AA3423|50
AB3988|44
AB3099|30
My hashed file may have this:
Product|Flag
AA|Y
AB3|N
I want my output to be:
Product|Quantity|Flag
AA1234|10Y
AA3423|50Y
AB3988|44N
AB3099|30N
So I want to join to the Hashed File using only the first few characters. But as you can see, I don't know exactly how many characters (sometimes 2 characters, sometimes the first 3).
I'm having trouble figuring this out. I can't put something like this in the Hashed File Key Expression because it won't let me access the Hashed File Values itself: SequentialFile.Product[1,Len(Hashed.Product)]
Any suggestions?
For instance, let's suppose my Sequential File has the following data:
Product|Quantity
AA1234|10
AA3423|50
AB3988|44
AB3099|30
My hashed file may have this:
Product|Flag
AA|Y
AB3|N
I want my output to be:
Product|Quantity|Flag
AA1234|10Y
AA3423|50Y
AB3988|44N
AB3099|30N
So I want to join to the Hashed File using only the first few characters. But as you can see, I don't know exactly how many characters (sometimes 2 characters, sometimes the first 3).
I'm having trouble figuring this out. I can't put something like this in the Hashed File Key Expression because it won't let me access the Hashed File Values itself: SequentialFile.Product[1,Len(Hashed.Product)]
Any suggestions?