'SSIS Slowly changing dimension column
I'm using a Slowly Changing Dimension in SSIS and I'm using a single column called active of type BIT to determine the latest records instead of start date and end date column.
My problem is the following: I want to turn the active value to 0 for records that are no more present in the source file.
For example imagine if my DWH is empty and in the source file I have the following data(Salary is the historisation attribute):
employee_ID|NAME|salary
117|a|100
125|b|150
378|c|200
Now once I charge those into my DWH I get the following data.
employee_code|employee_ID|NAME|salary|active
1|117|a|100|1
2|125|b|150|1
3|378|c|200|1
everything is good so far but now imagine I get a new source where the data is like this:
employee_ID|NAME|salary
117|a|120
125|b|150
Here when I charge this data in the datawarehouse I get the following:
employee_code|employee_ID|NAME|salary|active
1|117|a|100|0
2|125|b|150|1
3|378|c|200|1
4|117|a|120|1
Everything makes sense. Employee A's salary has changed so a new record is added in the DWH and the old record's active value turned to 0. Employee b's salary stayed the same so there is no need to add a new record. However mployee C does not exist in the source file anymore (He quit or got fired) I want to know if there is a way to turn the active value to 0 in such a situation
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
