Page 1 of 1

Creating History records using SCD stage

Posted: Mon Jun 11, 2012 9:36 am
by nikhil_bhasin
I have a scenario in which we will need to create history of a given record(based on some key) of the change of the status code:-

Input:-

key,status_cd,change_dt
1,C,2012-05-25
1,D,2012-05-29


Output:-

Key,status_cd,change_dt,effect_dt
1,C,2012-05-28,2012-05-25
1,D,9999-12-31,2012-05-29

Problem is there is no refernce history available, all the records are coming in a single input file and I have to generate change_dt and effect_dt for a given status_cd as shown in example.

Any thoughts on how it can be done using SCD stage?

Posted: Mon Jun 11, 2012 8:54 pm
by ray.wurlod
In a word, "automatically". Date management is part of regular Type 2 SCD processing using this stage. You can also set a "current" indicator.

Posted: Mon Jul 02, 2012 4:24 am
by nikhil_bhasin
Found a workaround using transformer and reducing some redundant requirements.