Look up based on two conditions
Moderators: chulett, rschirm, roy
Look up based on two conditions
Hi,
I have an issue as follows.
I have 2 source[1 flat file, 1 table].I need to look up the for data coming from the flat file to the table based on the following conditions:
If the field1 in the flat file is equal to Col2 or Col3 of the table .i need to pass the curresponding Col1 [the key column of the table]
Provide me a solution.
I have an issue as follows.
I have 2 source[1 flat file, 1 table].I need to look up the for data coming from the flat file to the table based on the following conditions:
If the field1 in the flat file is equal to Col2 or Col3 of the table .i need to pass the curresponding Col1 [the key column of the table]
Provide me a solution.
Thanks,kcbland wrote:Two lookups, use the results of one else if none then use the other. ...
I have used two hashed file lookups,And use the following logic in output column of transformer :
If not(IsNull(DSLink86.Col1))
then
Unit_Out.Col1
Else
if not(IsNull(DSLink89.Col1)) then DSLink89.Col1
else @NULL
DSLink86.Col1,DSLink89.Col1 are input links from lookups populating based on the first condition and second condition
But the matched data is not populating
Shouldn't
be
Code: Select all
If not(IsNull(DSLink86.Col1))
then
Unit_Out.Col1
Else
if not(IsNull(DSLink89.Col1)) then DSLink89.Col1
else @NULL
be
Code: Select all
If not(IsNull(DSLink86.Col1))
then
DSLink86.Col1
Else
if not(IsNull(DSLink89.Col1)) then DSLink89.Col1
else @NULL
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
I am not geeting you exatly..Please expalinkcbland wrote:Shouldn't
Code: Select all
If not(IsNull(DSLink86.Col1)) then Unit_Out.Col1 Else if not(IsNull(DSLink89.Col1)) then DSLink89.Col1 else @NULL
be
[code ...
Thanks,
I have used two hashed file lookups,And use the following logic in output column of transformer :
If not(IsNull(DSLink86.Col1))
then
Unit_Out.Col1
Else
if not(IsNull(DSLink89.Col1)) then DSLink89.Col1
else @NULL
DSLink86.Col1,DSLink89.Col1 are input links from lookups populating based on the first condition and second condition
But the matched data is not populating and getting the following warning
also
DataStage Job 657 Phantom 11508
Program "DSD.StageRun": Line 544, Attempted WRITE with NULL record ID
DataStage Phantom Finished
I have used two hashed file lookups,And use the following logic in output column of transformer :
If not(IsNull(DSLink86.Col1))
then
Unit_Out.Col1
Else
if not(IsNull(DSLink89.Col1)) then DSLink89.Col1
else @NULL
DSLink86.Col1,DSLink89.Col1 are input links from lookups populating based on the first condition and second condition
But the matched data is not populating and getting the following warning
also
DataStage Job 657 Phantom 11508
Program "DSD.StageRun": Line 544, Attempted WRITE with NULL record ID
DataStage Phantom Finished
Re: Look up based on two conditions
Das wrote:I have 2 source[1 flat file, 1 table].I need to look up the for data coming from the flat file to the table based on the following conditions:
If the field1 in the flat file is equal to Col2 or Col3 of the table .i need to pass the curresponding Col1 [the key column of the table]
What about normalising the lookup before comparing?
Take the two columns to compare and make only one key column of them.
Best regards
Andreas