I have stumbled upon a quirk with lookup_ext which is causing me a bit of greif. I need to do a very complex lookup and hit a roadblock with the last column compare. In this column it is possible to have a null value or a real value and this is where lookup_ext fails to match the records. Here is the example which is a simplified version of what I am doing, ;
Transaction Table
Record ID | Match_A | Match_B | Match_C |
---|---|---|---|
1 | Gloves | Leather | Brown |
2 | Gloves | Driving | Brown |
3 | Gloves | Leather | NULL |
4 | Gloves | Driving | NULL |
5 | Gloves | NULL | Brown |
6 | Gloves | NULL | Black |
Look-up Table
Match_A | Match_B | Match_C | Season | Stock_Ind |
---|---|---|---|---|
Gloves | Leather | Brown | Winter | Y |
Gloves | Leather | Black | Winter | N |
Gloves | Driving | Brown | Summer | N |
Gloves | Driving | Black | Summer | Y |
Gloves | Leather | NULL | Winter | Y |
Gloves | Driving | NULL | Summer | Y |
Gloves | NULL | Brown | Any Season | N |
Gloves | NULL | Black | Any Season | N |
NULL | Leather | Brown | Unknown | Y |
... and etc. |
I am using the Lookup_ext wizard as I have to return multiple columns, however when I run the routine it always fails to match where Null = Null. I am thinking that lookup_ext wants to only match Null when you specify Is Null but in this case i can't do that. Here is the output that the above tables in the Match Routine would give me.
Record ID | Match_A | Match_B | Match_C | Season | Stock_Ind |
---|---|---|---|---|---|
1 | Gloves | Leather | Brown | Winter | Y |
2 | Gloves | Driving | Brown | Summer | Y |
3 | Gloves | Leather | NULL | NULL | NULL |
4 | Gloves | Driving | NULL | NULL | NULL |
5 | Gloves | NULL | Brown | NULL | NULL |
6 | Gloves | NULL | Black | NULL | NULL |