Hi All,
I want to do a join on a table with a hash file. I have to join using 3 fields from the hash. While joining I shud be able to check whether the column I am joining with, has any data or not. If there is no data in that column then I have to join it with a default value.
I am facing difficulty in implementing this. Can anyone help me out with this.
Thanks
Preethi
Joins with Hash
Moderators: chulett, rschirm, roy
But you can use an expression in the Key value field. A simple If-Then-Else expression can put the link data into the key if is "not empty", otherwise it can use a default value to do the lookup.
Or you could do this in two lookups to the same hash, one using row data in the keys and one using defaults. Use the first results if the lookup succeeds, or use the second results if the first lookup fails.
Depends on how you need to handle your defaults.
Or you could do this in two lookups to the same hash, one using row data in the keys and one using defaults. Use the first results if the lookup succeeds, or use the second results if the first lookup fails.
Depends on how you need to handle your defaults.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: Joins with Hash
pkl wrote:Hi All,
I want to do a join on a table with a hash file. I have to join using 3 fields from the hash. While joining I shud be able to check whether the column I am joining with, has any data or not. If there is no data in that column then I have to join it with a default value.
I am facing difficulty in implementing this. Can anyone help me out with this.
Thanks
Preethi
You could use a If-Then-Else Construct while joining the input columns to the hash file fields within the transformer. This way the logical flow could be controlled.