Skip to main content

Hey y’all,

 

I was wondering if anyone had a quality rule or advice on how to construct a quality rule to check a date type field for formatting. I know there is the “matches” function for strings and that you can convert a date field to a string using “toString”, but that requires you to specify a format, which invalidates the point of the rule.

The desired format is “MM-dd-yyyy”, as shown in what I’ve got so far.

matches("^\d{4}-(0a1-9]|1"0-2])-(001-9]||12]-0-9]|3[01])$",toString(ATTRIBUTE_1, "MM-dd-yyyy"))

Hi ​@evan.sasowsky,

let me just comment regarding the data type. In case your date is stored in a date or datetime field, it doesn’t make sense to perform a format check because the formatting is based on the settings of your database and Ataccama has also some specific format how it displays the dates in the web application. But it is all just the visualization of the dates. So the format check makes sense only in case the dates are stored in string data types.

Kind regards,

Anna


Reply