# Generating a regular expression from the Date Pattern Frequency indicator

Available in...

* Big Data Platform
* Cloud API Services Platform
* Cloud Big Data Platform
* Cloud Data Fabric
* Cloud Data Management Platform
* Data Fabric
* Data Management Platform
* Data Services Platform
* Qlik Talend Cloud Enterprise Edition
* Qlik Talend Cloud Premium Edition
* Real-Time Big Data Platform

You can generate a regular pattern from the results of an analysis that uses the Date Pattern Frequency indicator on a date column.

## Before you begin

In the Profiling perspective of Talend Studio, a column analysis is created on a date column using the Date Pattern Frequency indicator.

Information noteNote: To be able to use the Date Pattern Frequency indicator on date columns, you must set the execution engine to Java in the Analysis Parameter view of the column analysis editor. For more information on execution engines, see [Using the Java or the SQL engine](https://help.qlik.com/talend/en-US/studio-user-guide/8.0/using-java-or-sql-engine).

For more information on how to create a column analysis, see [Creating a basic analysis on a database column](https://help.qlik.com/talend/en-US/studio-user-guide/8.0/creating-basic-analysis-on-database-column).

## Procedure

1. In the DQ repository tree view, right-click the column analysis that uses the date indicator on a date column.
2. Click Run analysis.

   ![Table and graphic for Date Pattern Frequency Statistics.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/generate_date_pattern2.png)

   In this example, 100.00% of the date values follow the pattern yyyy MM dd and 39.41% follow the pattern yyyy dd MM.
3. Right-click the date value for which you want to generate a regular expression and select Generate Regex Pattern from the contextual menu.

   The New Regex Pattern dialog box is displayed.
4. Click Next.

   The date regular expression is already defined in the corresponding field. In this example:'(A9|20)[0-9{2}(-|/|)([0-0][1-9]|10|11|12)(-|/|)[0-3][0-9]$'.
5. Click Finish to proceed to the next step.

   The pattern editor opens with the defined metadata and the generated pattern definition.

   The pattern editor opens with the defined metadata and the generated pattern definition. ![Overview of the Pattern Metadata and Pattern Definition sections.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/Generate-date-pattern6.png)

   The new regular expression is listed under Pattern &gt; Regex in the DQ repository tree view. You can drag it onto any date column in the analysis editor.
6. Optional: Click the Test button to test a character sequence against this date regular expression as outlined in [Testing a regular expression in the Pattern Test View](https://help.qlik.com/talend/en-US/studio-user-guide/8.0/testing-regular-expression-in-pattern-test-view).