Sunday, January 20, 2013

SCD TYPE1 MAPPING



The SCD Type 1 methodology overwrites old data with new data, and therefore does no need to track historical data .
  1. Here is the source

  1. We will compare the historical data based on key column CUSTOMER_ID.
  2. This is the entire mapping

  1. Connect lookup to source. In Lookup fetch the data from target table and send only CUSTOMER_ID port from source to lookup
  2. Give the lookup condition like this
  3. Then rest of the columns from source send to one router transformation
  4. In router create two groups and give condition like this
  5. For new records we have to generate new customer_id. For that  take a sequence generator and connect the next column to expression .New_rec group from router connect to target1(Bring two instances of target to mapping, one for new rec and other for old rec) .Then connect next_val from expression to customer_id column of target
  6. Change_rec group of router bring to one update strategy. and give the condition like this

Instead of 1 you can give dd_update in update-stratgy. Then connect to target

No comments:

Post a Comment

Thank you :
- kareem