Smart Naming Convention
This guide explains how to use the Smart Naming Convention transformation to detect and apply naming conventions in your data.
Introduction
Use the Smart Naming Convention transformation to let Adverity detect your naming convention based on patterns in your data and enforce these conventions. Adverity monitors if data complies with the naming convention and notifies you about discrepancies.
Naming conventions are a set of rules that define how your data is presented, formatted, and structured. They specify the appropriate naming of the fields and values in the data set, and ensure your data is presented in a consistent and standardized manner. Use the Smart Naming Convention transformation to enforce your naming convention and ensure the high quality of your data. For example, the Smart Naming Convention transformation can automatically identify and flag missing data, and correct misaligned data sets.
The Smart Naming Convention transformation is a premium feature available upon request.
The Smart Naming Convention transformation uses the namingconvention custom script instruction. The Smart Naming Convention transformation provides a user-friendly interface that helps you create the regular expression used to find and split the fields.
This video guide explains how to create and configure the Smart Naming Convention transformation.
Prerequisites
Before you complete the procedure in this guide, perform all of the following actions:
-
Use consistent naming conventions in your data.
-
Use delimiters (special characters) in string values to separate pieces of information. For example, you can use the delimiter
|
to separate pieces of information in the valueEN | retail | lead
. -
Place the same information in the same position in string values. For example, if you have a column with values like
EN | retail | lead
andFR | retail | lead
, the country code must be in the beginning of the column value.
Configuring the Smart Naming Convention transformation
This guide explains how to configure the Smart Naming Convention transformation. Before completing this step, start creating a transformation by following the instructions in Using standard transformations. To configure this transformation, follow these steps:
-
In Select column, click the source column for which you want to enforce naming conventions. You can only choose a column that is mapped as a dimension with the string data type. For more information on Data Mapping, see Applying Data Mapping to a datastream.
-
Click Next.
-
In Exclude values, deselect any values in the source column that are not consistent with your naming convention. Adverity only uses the selected values when it detects the rules of your naming convention.
-
Click Next.
-
In Rules and delimiters, confirm that Adverity correctly detected the rules of your naming convention by checking the following fields:
-
Delimiters detected
-
In this section, enable the delimiters that you want Adverity to use. You must enable at least one delimiter.
You can see the delimiters that Adverity has detected. For example, if you use the delimiter
|
, the valueEN | retail | lead
is broken up into the partsEN
,retail
, andlead
. Adverity creates new columns based on these values in your data extract.For more information on supported delimiter characters, see Supported delimiters.
For more information on the date formats you can use in the source column, see Supported date formats.
-
Rules detected
-
In this section, configure the rules that you want Adverity to use. To edit a rule, click Edit.
You can see the rules that Adverity has detected in your source column, and the new columns created based on the delimiters you specify. The rules explain what the values in each new column must look like. For example, when the split values are
EN
and2021
, the detected rules are:-
Column 1 contains only upper case characters of length 2.
-
Column 2 contains only numbers of 4 digits.
-
-
Using predefined values
If you select Predefined values in the Data type field, you can define up to 1000 values. When entering values in the Allowed values field, you can copy and paste a list of values from Google Sheets or Excel. The values are case-sensitive.
-
Split preview
-
Here, you can preview the new columns that will be added to your data extract using the delimiters and rules enabled in the sections above.
-
-
Click Next.
-
In Set headers, enter names for the new columns that are added to your data extract.
-
Click Next.
-
In Receive errors, choose what Adverity should do if the source column contains a value that your Smart Naming Convention transformation cannot split in any way (for example, if a value does not contain any delimiters).
-
Send email
-
If Adverity encounters an error, an email notification is sent to the email addresses specified in the datastream notification settings. Errors will always be displayed in the datastream overview as well.
-
Continue processing
-
If Adverity encounters an error, the Smart Naming Convention transformation continues. This may result in inconsistencies in your data extract because some values will be enriched and some will not.
If this checkbox is cleared, the transformation process will stop if an error occurs.
-
Add status columns to data extracts
-
Select this checkbox to add three columns to your data extract that show whether a row meets the conditions of the Smart Naming Convention transformation. The snc_passed column shows the items in the row that following the naming conventions. The snc_failed column shows the items in the row that do not follow the naming conventions. The snc_status column shows whether each row as a whole has followed the naming convention.
-
-
Click Next.
-
In Receive warnings, choose what Adverity should do if the source column contains a value that is not fully consistent with the rules of your Smart Naming Convention transformation, but Adverity can try to split (for example, if one element of the value in the source column is missing).
-
I want to be informed in the following cases
-
Enable the toggles for the situations in which you want to be informed of the inconsistent values.
-
Send email
-
If Adverity finds an inconsistency, an email notification is sent to the email addresses specified in the datastream notification settings.
-
Raise warning
-
If Adverity finds an inconsistency, a notification about the inconsistent values is displayed in the datastream overview.
-
-
Click Next.
-
(Optional) In Name the transformation, enter a name for this Smart Naming Convention transformation.
-
Click Next.
-
In the Summary page, check the details of the Smart Naming Convention transformation. If you need to make any changes, click the corresponding step in the list on the left to go back.
-
Click Create +.
Supported delimiters
You can use the following characters as delimiters in a Smart Naming Convention transformation:
Character |
Name |
---|---|
| |
vertical bar |
- |
hyphen |
, |
comma |
; |
semicolon |
~ |
tilde |
_ |
underscore |
/ |
slash |
|
space |
. |
dot |
+ |
plus sign |
# |
hash sign |
$ |
dollar sign |
ยง |
section sign |
Supported date formats
You can use the following data formats in the source column for a Smart Naming Convention transformation:
-
%d/%m/%Y
-
%d-%m-%Y
-
%d_%m_%Y
-
%d.%m.%Y
-
%m/%d/%Y
-
%m-%d-%Y
-
%m_%d_%Y
-
%m.%d.%Y
-
%Y/%m/%d
-
%Y-%m-%d
-
%Y_%m_%d
-
%Y.%m.%d
Editing an existing Smart Naming Convention transformation
After creating a Smart Naming Convention transformation, you can change the rules, column names and notification settings it uses. To do this, follow these steps:
-
Go to the Transformations page.
-
Select the Smart Naming Convention transformation you want to edit.
-
In the Rules and delimiters.
on the left, select the setting you want to edit, e.g. -
Edit the Smart Naming Convention transformation configuration.
-
Click Apply.
You cannot change the source column or the delimiters used in the Smart Naming Convention transformation.