Match Transformation: Convert String to Date
The Convert String to Date transformation allows date values that are held in String attributes to be converted into actual Date attribute values when clustering. This works in exactly the same way as the main Convert String to Date processor, but may be useful to apply purely for clustering purposes.
Note that Convert String to Date cannot be used within Comparisons.
Use the Convert String to Date transformation where you have date values held in a String identifier (for example, because you imported the data from a text file or other format with no specific data typing), and where you want to cluster on a formalized Date value, resolving any differences in manually entered date formats. Note that any String representations of dates that do not match any date formats in the Reference List used will be converted to Null date values.
Note that if you have many different representations of dates in your text field, and you need to review the results of the conversion, you should use the main Convert String to Date processor prior to matching.
The following table describes the configuration options:
Configuration | Description |
---|---|
Options |
Specify the following options:
|
Example
In this example, data has been imported from a text file, so all attributes have String types. In Data Type Profiling (see Data Types Profiler), one of the attributes was found to contain date values corresponding to dates of birth, useful in matching. The data is converted to a Date format so that specific date comparisons can be used on it.
Example configuration
List of recognized date formats: *Date Formats
Note that the provided Reference Data *Date Formats contains a series of common date formats that will convert many different String representations of date values into values for an actual date attribute.
Example transformations
The following table shows examples of transformations using the above configuration:
Table 1-77 Example Transformations for Convert String to Date
Value | Transformed Value |
---|---|
1/Dec/1970 (String) |
01-Dec-1970 00:00:00 (date) |
01/12/1970 (String) |
01-Dec-1970 00:00:00 (date) |
01/12/70 (String) |
01-Dec-1970 00:00:00 (date) |
17-11-1957 (String) |
17-Nov-1957 00:00:00 (date) |
July 12th 68 (String) |
Null (not converted) |
not supplied (String) |
Null (not converted) |