Page 1 of 1

How to expire the old record

Posted: Tue Apr 04, 2006 7:43 am
by Ratan Babu N
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.

Posted: Tue Apr 04, 2006 2:44 pm
by ray.wurlod
If it's Type 2 SCD there is no such thing as "update the previous record". The old record is expired as soon as any update comes through. In that way history can be re-built as required, which is the point of Type 2 SCD. The remainder of your question is therefore moot.