How to expire the old record
Posted: Tue Apr 04, 2006 7:43 am
Hi,
I have an issue in expiring the old record ( SCD type2)
for me if a record fails on certain lookups then i dont process that particular record. If that record fails for a couple of days and update comes on that record (means the old record as well as this record all are new) so before inserting the new record, i have to expire the old record which is not existing in the warehouse at all.
For eg: Record A fails on Day 1 and Day2
Record B fails on Day 2
Records A,B and C Succeds on Day3. So before inserting C, I have to Expire B with Fileheader Date of C and Before Inserting B , I have to Expire A with File Header Date of B.(surrogate key is same but only Process time is different for all these). As all these 3 records are inserting on the same day, How can I achieve this in a Transformer Stage )
I used 3 stage variables and Transformer operating in a sequential mode
sv1 : it will take the natural key of incoming record
sv2 : If sv1 = sv3 then Fileheader Date else high date
sv3 : it will take the natural key of incoming record
But in this way, I am not getting the File header date of previous record. how to catch the File header date of previous record instead of processing record.
I have an issue in expiring the old record ( SCD type2)
for me if a record fails on certain lookups then i dont process that particular record. If that record fails for a couple of days and update comes on that record (means the old record as well as this record all are new) so before inserting the new record, i have to expire the old record which is not existing in the warehouse at all.
For eg: Record A fails on Day 1 and Day2
Record B fails on Day 2
Records A,B and C Succeds on Day3. So before inserting C, I have to Expire B with Fileheader Date of C and Before Inserting B , I have to Expire A with File Header Date of B.(surrogate key is same but only Process time is different for all these). As all these 3 records are inserting on the same day, How can I achieve this in a Transformer Stage )
I used 3 stage variables and Transformer operating in a sequential mode
sv1 : it will take the natural key of incoming record
sv2 : If sv1 = sv3 then Fileheader Date else high date
sv3 : it will take the natural key of incoming record
But in this way, I am not getting the File header date of previous record. how to catch the File header date of previous record instead of processing record.