Skip to main content
Delphix

Algorithm: Date Shift (KBA1812)

 

 

KBA

KBA#1812

Overview

There are three built-in Date Shift algorithms: 

  • DATE SHIFT(DISCRETE)
    • Will mask all dates in a specific year-month to the same day.
    • A new day for each year-month combination. 
    • Creates duplicates, as all days are the same within year-month.
    • Will maintain referential Integrity.
  • DATE SHIFT(FIXED)
    • Will offset the day by a specific value.
    • Does not create duplicates - 1:1 mapping.
    • Will maintain referential Integrity.
  • DATE SHIFT(VARIABLE)
    • Will randomize the day to a different value.
    • Will not mask to the same value.
    • Creates 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.

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases
6.0 6.0.0.0, 6.0.1.0

5.3

5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1

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

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,... are (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 not 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. 

  • ID reference number.
  • Orig - The Original date.
  • YM_Key - The Year Month key.
  • Mask_Disc - The masked value using Discrete. 
  • Mask_Fixed- The masked value using Fixed. 
  • Mask_Var - The masked value using Variable. 
+----+------------+---------+------------+------------+------------+
| ID |    Orig    | YM_Key  |  Mask_Disc | Mask_Fixed |  Mask_Var  |
+----+------------+---------+------------+------------+------------+
| 1  | 1977-02-01 | 1977-02 | 1977-02-18 | 1977-02-06 | 1977-02-09 | << Same source date,
| 2  | 1977-02-01 | 1977-02 | 1977-02-18 | 1977-02-06 | 1977-02-05 |    Variable different.
+----+------------+---------+------------+------------+------------+
| 3  | 1978-02-01 | 1978-02 | 1978-02-19 | 1978-02-06 | 1978-02-02 | << New Year Month key.
+----+------------+---------+------------+------------+------------+
| 4  | 1978-03-01 | 1978-03 | 1978-03-19 | 1978-03-06 | 1978-03-05 | << New Year Month key, can
| 5  | 1978-03-02 | 1978-03 | 1978-03-19 | 1978-03-07 | 1978-03-09 |    generate same masked day.
+----+------------+---------+------------+------------+------------+
| 6  | 1978-04-01 | 1978-04 | 1978-04-28 | 1978-04-06 | 1978-04-09 | << New Year Month key
| 7  | 1978-04-02 | 1978-04 | 1978-04-28 | 1978-04-07 | 1978-04-06 |
| 8  | 1978-04-25 | 1978-04 | 1978-04-28 | 1978-04-30 | 1978-04-04 |  
| 9  | 1978-04-26 | 1978-04 | 1978-04-28 | 1978-04-01 | 1978-04-05 | <  Fixed rolled.
| 10 | 1978-04-28 | 1978-04 | 1978-04-28 | 1978-04-03 | 1978-04-07 | <  Same day as input.  
| 11 | 1978-04-29 | 1978-04 | 1978-04-28 | 1978-04-04 | 1978-04-08 |
| 12 | 1978-04-30 | 1978-04 | 1978-04-28 | 1978-04-05 | 1978-04-01 |
+----+------------+---------+------------+------------+------------+
Note: DateShift Fixed and Variable will never be the same as the input.


With date
+----+------------------+---------+------------------+------------------+------------------+
| ID |       Orig       | YM_Key  |     Mask_Disc    |     Mask_Fixed   |    Mask_Var      |
+----+------------------+---------+------------------+------------------+------------------+
| 1  | 1978-04-30 14:34 | 1978-04 | 1978-04-28 14:34 | 1978-04-04 14:34 | 1978-04-08 14:34 |
+----+------------------+---------+------------------+------------------+------------------+

 


 

 

 

Related Articles