Date Shift Discrete
The Date Shift Discrete algorithm masks all dates within the same year–month combination to the same fixed day. This means that:
-
All dates in the same month and year will mask to the same day value (for example, every date in February 2020 → 2020-02-06).
-
The masked value for a given year–month combination remains consistent across jobs when the same algorithm key is used.
-
If the same job is executed again, masked values will not change.
Because one masked date represents many original dates, duplicates are expected. On average, one out of every 30 dates may mask to the same result.
As an example, any inputs with a year-month combination of February 2020 may return a day value of 23 while any inputs with a year-month combination of January 2020 may return a day value of 5. All values of the input other than the day value are preserved. This algorithm is deterministic based on an algorithm key. The out-of-the-box instance of this algorithm is called DateShiftDiscrete.
Key characteristics
-
Masks all dates in the same year–month to a single, consistent day.
-
Duplicates are expected: multiple inputs in the same year–month mask to the same output.
-
Deterministic: re-running the job does not change outputs for the same input values.
-
Preserves year, month, time, and timestamp components; only the day value is changed.
-
Default algorithm for the “Date of Birth (DOB)” domain.
Example
-
"1989-11-19 00:00:00" → "1989-11-30 00:00:00"
-
"1989-12-19 04:15:00" → "1989-12-24 04:15:00"
-
"2012-11-19 17:00:55" → "2012-11-08 17:00:55"
-
"2012-11-09 00:23:59" → "2012-11-08 00:23:59"
Duplicate behavior in DateShift Discrete
| ID | Original | DS Discrete | DS Fixed | DS Variable | Note |
|---|---|---|---|---|---|
|
1 2 |
NULL | NULL | NULL | NULL | Passthrough values |
|
3 4 |
1977-02-01 1977-02-01 |
1977-02-06 1977-02-06 |
1977-02-06 1977-02-06 |
1977-02-03 1977-02-10 |
id 3 same as 4 Variable has different value. |
|
3 5 |
1977-02-01 1978-02-01 |
1977-02-06 1978-02-20 |
1977-02-06 1978-02-06 |
1977-02-10 1978-02-04 |
Different year |
|
3 6 |
1977-02-01 1977-03-01 |
1977-02-06 1977-03-13 |
1977-02-06 1977-03-06 |
1977-02-10 1977-03-06 |
Different month |
|
3 7 |
1977-02-01 1977-02-02 |
1977-02-06 1977-02-06 |
1977-02-06 1977-02-07 |
1977-02-10 1977-02-12 |
Different day |
|
8 9 10 11 12 13 14 15 |
1978-04-25 1978-04-26 1978-04-27 1978-04-28 1978-04-29 1978-04-30 1978-05-01 1978-05-02 |
1978-04-06 1978-04-06 1978-04-06 1978-04-06 1978-04-06 1978-04-06 1978-05-24 1978-05-24 |
1978-04-30 1978-04-01 1978-04-02 1978-04-03 1978-04-04 1978-04-05 1978-05-06 1978-05-07 |
1978-04-01 1978-04-28 1978-04-01 1978-04-29 1978-04-07 1978-04-07 1978-05-03 1978-05-06 |
Month rollover |
Note: DateShift Fixed and Variable will never mask to the same as the input.