1.3.3.9.3 Match Transformation: Convert Date to String
The Convert Date to String transformation converts identifiers with a Date data type into String values for the purpose of clustering values when matching.
This works in the same way as the main Convert Date to String processor. This help page gives an example of using the transformation when clustering.
Note that Convert Date to String cannot be used within Comparisons.
Use the Convert Date to String transformation if you require a String representation of a date value, for example so that you can trim the value down to its day, month or year part.
The most common use of this is when clustering date values, using a part of the date only (such as the year). The date is first converted to a String format, and then the relevant two or four characters that represent the year are selected using a Last N Characters transformation (see Match Transformation: Last N Characters).
The following table describes the configuration options:
Configuration | Description |
---|---|
Options |
Specify the following options:
|
Note:
The date format expressed must conform to the standard Java 1.5.0 or Java 1.6.0 SimpleDateFormat
API. To understand how to specify a format for the correct output of dates, see the online Java documentation at http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html.
Example
In this example, the Convert Date to String is used to convert a DATE_OF_BIRTH
attribute to a String type, with a view to extracting the year part using a Last n Characters transformation, and using the year value in a cluster.
Example configuration
Date format String: dd/MM/yyyy
Example transformations
The following table shows examples of conversions using the above configuration:
Table 1-75 Example Transformations for Convert Data to String
Value | Transformed Value |
---|---|
29-Nov-1976 00:00:00 |
29/11/1976 |
03-Apr-1949 00:00:00 |
03/04/1949 |
11-Jan-1962 00:00:00 |
11/01/1962 |