The CDATE comparison function is used with the CDATE standardization and bucketing functions to facilitate the comparison of incomplete, partially valid, or approximate date ranges.
The CDATE comparison function is based on the overlap between the two date ranges being compared.
- Number of roles
- Number of dimensions
(in each role)
- Weight table
- mpi_wgthead, mpi_wgt2dim
- The function uses a two-dimensional (2-dim) comparison function.
- The function substitutes 07 for a missing month and 14 for a missing day. The substitution is used to avoid incorrect matches with missed anonymous dates.
- If the dates are complete and exact, the dimensions are (1,1). If the dates ranges do not overlap, the dimensions are (15,15)
- If the date ranges overlap:
- Dimension 1 is based on how far apart the two dates are (diffDays).
- Dimension 2 is based on precision. The precision is defined by the lower of the two resolution values (implying a more precise date).
- The two-dimensional weight table indexes run from 0 to 15, in which (0, 0) signifies missing dates, (1, 1) signifies equal date ranges and (15, 15) signifies no overlap of date ranges. To handle overlapping dates, the precision and diffDays values must be quantized to fall between the 2-14 dimension range.
This table provides a feel for the indexes computed for the two dimensions given (diffDays and precision) in days.
|Number of days||Index||Approximate number of years|