I have a master table with following columns
Table1
-----------
Code
Type
LookupValue
Code and Type columns are primary keys.
The sample data for this table will look like this
Code Type LookupValue
-------------------------------------------------------
A all 1
B exclude X 2
C exclude Y 3
D include Z 4
B include X 5
C include Y 6
D exclude Z 7
This means that a CODE=A with all possible combinations of TYPE will result in a lookup value of 1.
Similarly, CODE=B and all values of TYPE other than X will result in a lookup value of 2
and CODE=B and all TYPE = X will result in a lookup value of 5.
And so on...
Note that, I do not have an exploded form of the master list. I receive the master list in the above format.
I will receive the fact data in a file in the following format
Code Type FactData
-------------------------------------
A X
A Y
B X
B Z
Please advise me as to how to select the correct lookup value from the master table while processing the fact file.
Table1
-----------
Code
Type
LookupValue
Code and Type columns are primary keys.
The sample data for this table will look like this
Code Type LookupValue
-------------------------------------------------------
A all 1
B exclude X 2
C exclude Y 3
D include Z 4
B include X 5
C include Y 6
D exclude Z 7
This means that a CODE=A with all possible combinations of TYPE will result in a lookup value of 1.
Similarly, CODE=B and all values of TYPE other than X will result in a lookup value of 2
and CODE=B and all TYPE = X will result in a lookup value of 5.
And so on...
Note that, I do not have an exploded form of the master list. I receive the master list in the above format.
I will receive the fact data in a file in the following format
Code Type FactData
-------------------------------------
A X
A Y
B X
B Z
Please advise me as to how to select the correct lookup value from the master table while processing the fact file.