1.3.10.10 Convert Number to Date
The Convert Number to Date processor transforms Number or Number Array values that actually represent date values into the formal Date or Date Array type respectively.
Dates are often internally stored in databases as numbers, counted as a number of units (days, seconds, or milliseconds) from a given base date and time.
The formatting of these values as date or date/time values is often done using functions to retrieve the numeric values and present them as dates.
Depending on the way in which data is extracted from a source database, these date values may be captured as numbers. If EDQ only has access to the database extract, and not to the source database, it will therefore snapshot the values as numbers. It is then necessary to convert the numbers to a standard date format in order to process the dates correctly.
The Convert Number to Date processor, therefore, uses a configured base date, and a number of units, to calculate Date values from numeric values.
The following table describes the configuration options:
Configuration | Description |
---|---|
Inputs |
Specify one or more Number or Number Array attributes for conversion to a Date or Date Array type. String and Date attributes are not valid inputs. If multiple attributes are submitted for conversion and one fails the entire record is marked as having failed, although the valid attributes will be correctly converted. |
Options |
Specify the following options:
|
Outputs |
Describes any data attribute or flag attribute outputs. |
Data Attributes |
The following data attributes are output:
|
Flags |
The following flags are output:
|
The following table describes the statistics produced by the profiler:
Statistic | Description |
---|---|
Successful |
The number of records where the Number to Date conversion was successful (that is, a Date was calculated). |
Unsuccessful |
The number of records where the Number to Date conversion was unsuccessful (that is, a Date could not be calculated). |
Output Filters
The following output filters are available:
-
Records where conversion was successful
-
Records where conversion was unsuccessful
Example
In this example, date values have been wrongly formatted as numbers in an Excel spreadsheet. The EDQ user has read-only access to the spreadsheet so cannot change the formatting, so converts the numbers to dates using this processor and the default configuration:
DateOfBirth | DateOfBirth.NumberToDate |
---|---|
18639 |
11-Jan-1951 00:00:00 |
19003 |
10-Jan-1952 00:00:00 |
17126 |
20-Nov-1946 00:00:00 |
28885 |
30-Jan-1979 00:00:00 |
{28885}{24800} |
{30-Jan-1979 00:00:00}{24-Nov-1967 00:00:00} |