Surrogate key generation problem
Posted: Sun Aug 28, 2005 8:12 am
I have two links namely customers,maxcustomer.
customer link outputs all customer present in sequential file named customer.txt which has 1000 rows.
maxcustomer link outputs maximum customerid present in sequential file customer.txt.
I need to generate surrogate key for the customer dimension such that surrogate key starts from (maxcustomerid + 1).
i decided to use transformer to calculate surrogate key.So, in transformer i need to have maxcustomerid.But transformer takes only one link as input so i needed to merge customer link and maxcustomerlink.
For merging two links I decided to go for lookup stage.Lookup stage outputs all columns of customers + one column containing the maxcustomerid.In Lookup stage conditions dialog i had given lookfailure to "continue".The lookup suceeds for one row and i get maxcustomerid,but for rest of rows where lookup fails i get maxcustomerid to be 0.I want the maxcustomerid to be present in all rows so that in transformer stage i can generate surrogate key as (maxcustomerid + inrownumber)
Is my approach correct or am i making any basic mistake?
Please guide me.
Regards
Balaji
customer link outputs all customer present in sequential file named customer.txt which has 1000 rows.
maxcustomer link outputs maximum customerid present in sequential file customer.txt.
I need to generate surrogate key for the customer dimension such that surrogate key starts from (maxcustomerid + 1).
i decided to use transformer to calculate surrogate key.So, in transformer i need to have maxcustomerid.But transformer takes only one link as input so i needed to merge customer link and maxcustomerlink.
For merging two links I decided to go for lookup stage.Lookup stage outputs all columns of customers + one column containing the maxcustomerid.In Lookup stage conditions dialog i had given lookfailure to "continue".The lookup suceeds for one row and i get maxcustomerid,but for rest of rows where lookup fails i get maxcustomerid to be 0.I want the maxcustomerid to be present in all rows so that in transformer stage i can generate surrogate key as (maxcustomerid + inrownumber)
Is my approach correct or am i making any basic mistake?
Please guide me.
Regards
Balaji