Date Shift (Algorithm frameworks)

The Date Shift framework masks date values to different dates based on a specified range around the input value. Masked values are calculated algorithmically using the algorithm's key, so rekeying the algorithm will cause different outputs to be generated for each input. All valid input values will be masked to a new value, and the new value will never match the input.

Creating a date shift algorithm via UI

  1. At the top right of the Algorithms page, click + Algorithm.

    date shift

  2. Enter an Algorithm Name.

    Info: This MUST be unique.

  3. Enter a Description.

  4. Select Date Shift as the Framework Name and click Next.

    date shift

  5. Enter Min Value and Max Value. These values provide a range in which the masked value will differ from the input given a specified unit of time. The range is inclusive of both values where negative values represent units of time in the past and positive values represent units of time in the future. 0 may be included in the range or as one of the range values, but the input will not mask to the same value. A minimum value and maximum value that are equal will result in a fixed shift of that amount of time. For example, entering 3 as a min value and 3 as a max value with a unit of Days will mask all input values to 3 days in the future.

  6. Additional notes on Date Shift configuration
    • If 0 is included in the range, it is never used to avoid masking a value to itself.
    • To create a Fixed Date Shift, set the same value for both Min and Max.

    • Fixed Date Shift preserves uniqueness and referential integrity, unlike variable ranges.

    • This is required for deterministic output (e.g., data joins and unique keys).

  7. Check the Roll box to preserve all units of time larger and smaller than the specified unit. Only the value of the specified unit will change. This option is supported for units months, days, hours, minutes, and seconds.

  8. Choose the Unit of time from the drop-down: Years, Months, Days, Hours, Minutes, or Seconds. This represents the unit of time the range is expressed in.

  9. Click Next to verify details on the Summary step.

    date shift

  10. When you are finished, click Save.

For more information for available Date Shift presets, refer to Out-of-the-Box Framework Algorithms page. For information on creating Date Shift algorithms through the API, see API Calls for Creating Algorithms - Date Shift.

Examples

As an example, a Date Shift algorithm with a minimum value of 3 and a maximum value of 5 with the unit set to Days will shift the input value from 3 to 5 days into the future. Dates may mask as follows:

  • "2021-02-03 12:30:00" → "2021-02-06 12:30:00"

  • "1905-12-10 00:00:00" → "1905-12-15 00:00:00"

  • "2001-07-31 23:45:30" → "2001-08-04 23:45:30"

With roll enabled and the same configuration, a date at the end of a month will wrap around to the beginning of the month. Dates may mask as follows:

  • "2021-02-25 10:00:00" → "2021-02-01 10:00:00"

  • "1932-05-03 01:15:15" → "1932-05-08 01:15:15"

  • "1999-08-31 18:30:00" → "1999-08-03 18:30:00"

All inputs with the same value masked with the same algorithm configuration will result in the same output values.