Creating History records using SCD stage
Posted: Mon Jun 11, 2012 9:36 am
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?
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?