Skip to main content
Delphix

Algorithm: Date Shift (KBA1812)

 

There are three built-in Date Shift algorithms: 

  • DATE SHIFT(DISCRETE)
    • Will mask to all dates in a specific year-month to the same day
    • Creates duplicates within the same year-month
    • Will maintain referential Integrity
  • DATE SHIFT(FIXED)
    • Will offset all dates by day of the month by a specific value
    • Will not create duplicates - 1:1 mapping
    • Will maintain referential Integrity
  • DATE SHIFT(VARIABLE)
    • Randomize the day of the month
    • Will not mask to the same value
    • Can create duplicates
    • Will not maintain referential integrity

At a Glance 

Description:

This page describes three built-in algorithms. The masked value is calculated.
The algorithms are fast and lightweight.

Characteristics:  
 
Type
Referential
Integrity1

1:1 Mapping2
Discrete Code based Yes  No - day duplicated
Fixed Code based Yes Yes
Variable Code based No - Random No - day duplicated

1 Referential Integrity - The masked value will be the same between job executions as well as tables.
2 1:1 Mapping - The masked value will be mapped uniquely to the input value.

Data Type: Date, DateTime, char, varchar, nchar, nvarchar.
Character 
Encoding:

Numeric values - in any date format (with the year, month and day).

Lookup Pool Size: Not applicable - there is none. 
Limitations: Will only mask day in the date. Year and month will stay the same.
Customization:

None.

Creating and Modifying Algorithms using the User Interface

These algorithms are built-in and cannot be created or modified. 

To select them, go to the Inventory and select the desired Algorithm using the selector.

Date 

The algorithm masks only the day part of the date (timestamp).
The year, month, hour, min,... is (intact) left as is. 

Date Formats 

A date format must be specified, this field appears when you select the DATE SHIFT algorithm from the Masking Algorithm dropdown list.

The default format is yyyy-MM-dd and the list contains some common formats. You can also type the date format desired if the date format is listed. 

Memory Requirements 

These algorithms have a very small memory footprint. 

Issue 

Special characters and non-dates might cause the algorithm to fail. 

Examples 

Below are examples of the three algorithms: Discrete, Fixed, and Variable. 

+-----+---------------------+---------------------+---------------------+---------------------+
| Ref | Source              | Discrete            | Fixed               | Variable            |
+-----+---------------------+---------------------+---------------------+---------------------+
| 1   | 2018-03-01          | 2018-03-20          | 2018-03-06          | 2018-03-05          |
+-----+---------------------+---------------------+---------------------+---------------------+
| 2   | 2018-03-01          | 2018-03-20          | 2018-03-06          | 2018-03-07          |  << Same source date,
+-----+---------------------+---------------------+---------------------+---------------------+     Variable different
| 3   | 2018-03-02          | 2018-03-20          | 2018-03-07          | 2018-03-11          |
+-----+---------------------+---------------------+---------------------+---------------------+
| 4   | 2018-03-03          | 2018-03-20          | 2018-03-08          | 2018-03-13          |
+-----+---------------------+---------------------+---------------------+---------------------+
| 5   | 2018-03-30          | 2018-03-20          | 2018-03-04          | 2018-03-05          |
+-----+---------------------+---------------------+---------------------+---------------------+
| 6   | 2018-03-31          | 2018-03-20          | 2018-03-05          | 2018-03-10          |
+-----+---------------------+---------------------+---------------------+---------------------+
| 7   | 2019-04-03          | 2019-04-28          | 2019-04-08          | 2019-04-07          |
+-----+---------------------+---------------------+---------------------+---------------------+
| 8   | 2019-04-04 03:30:04 | 2019-04-28 03:30:04 | 2019-04-09 03:30:04 | 2019-04-11 03:30:04 |  << Date with time
+-----+---------------------+---------------------+---------------------+---------------------+

Applicable Delphix Versions

This article applies to the following versions of the Delphix Engine:

Major Release

Sub Releases

5.2 5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1

5.1

5.1.0.0, 5.1.1.0, 5.1.2.0, 5.1.3.0, 5.1.4.0, 5.1.5.0, 5.1.5.1, 5.1.6.0, 5.1.7.0, 5.1.8.0, 5.1.8.1, 5.1.9.0, 5.1.10.0

5.0

5.0.1.0, 5.0.1.1, 5.0.2.0, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.3.0, 5.0.3.1, 5.0.4.0, 5.0.4.1 ,5.0.5.0, 5.0.5.1, 5.0.5.2, 5.0.5.3, 5.0.5.4

4.3

4.3.1.0, 4.3.2.0, 4.3.2.1, 4.3.3.0, 4.3.4.0, 4.3.4.1, 4.3.5.0

4.2

4.2.0.0, 4.2.0.3, 4.2.1.0, 4.2.1.1, 4.2.2.0, 4.2.2.1, 4.2.3.0, 4.2.4.0 , 4.2.5.0, 4.2.5.1

4.1

4.1.0.0, 4.1.2.0, 4.1.3.0, 4.1.3.1, 4.1.3.2, 4.1.4.0, 4.1.5.0, 4.1.6.0

4.0

4.0.0.0, 4.0.0.1, 4.0.1.0, 4.0.2.0, 4.0.3.0, 4.0.4.0, 4.0.5.0, 4.0.6.0, 4.0.6.1