A mask describes the shape of a data value based on a pattern of alphabetic and numeric characters. In certain cases, the mask can also include special characters and spaces. A mask recode is a user-defined revision or recoding of a mask shape which modifies or replaces the original mask with a new mask.
Recoded masks are useful, for example, if you are standardizing the way your company enters phone numbers into a database or the way you enter data for customer addresses and postal codes. With mask recoding you can apply global changes to data formats and structures, and be assured that the resulting data values are consistent in their format and presentation. The Quality Transformer process can use tables of recoded masks to standardize and clean data.
-
See example…
-
A phone number represented as (608) 888-6060
or 6088886060
can be recoded to 608-888-6060
by using a mask NNN-NNN-NNNN
.
Each record in a recode table contains two columns:
- Example
-
In this scenario, you want to change your date format to an NN/NN/NN
format. You will need to insert leading zeros (0) as appropriate, and convert embedded hyphens to forward slashes (/).
You do this using a recode table that specifies the original mask shape in one column and the new mask shape in a second column. The recode table looks like this:
Original Mask
|
New Mask
|
N/N/NN
|
0N/0N/NN
|
NN/N/NN
|
NN/0N/NN
|
N/NN/NN
|
0N/NN/NN
|
N/N/N
|
0N/0N/0N
|
NN/N/N
|
NN/0N/0N
|
N/NN/N
|
0N/NN/0N
|
N-N-NN
|
0N/0N/NN
|
NN-N-NN
|
NN/0N/NN
|
N-NN-NN
|
0N/NN/NN
|
N-N-N
|
0N/0N/0N
|
NN-N/N
|
NN/0N/0N
|
To recode masks
-
In the Navigation View, click the Discover bar, and click the Entities tab.
-
Expand the entity that contains the attribute with which you want to work.
-
Right-click the attribute and select Drill down to metadata. (You can also open the attribute's Summary Data View, and click Attribute Metadata.)
The List View of attribute metadata displays.
-
Double-click the row of Masks metadata.
The Masks List View displays.
-
Select rows that contain the masks you want to recode.
-
Right-click the selection and select Recode Masks.
The Recode Masks window opens, displaying a list of masks selected for recode.
-
Specify the new mask to use for the recode.
-
Tell me how…
-
You recode mask values in these ways:
To…
|
Action
|
Recode a single mask
|
- Double-click the original mask value in the value column.
- Enter the new (recode) mask in the to field.
- Click OK.
- Enter the new (recode) mask in the to field.
- Click OK.
- Click OK.
|
Recode multiple masks to the same mask
|
- Select the masks you want to recode.
To select all masks, right-click and select Select All.
- Right-click and select New.
- Enter the new (recode) mask. If the new mask is one of the masks you selected, use the drop-down menu to select this mask.
- Click OK.
- Enter the new (recode) mask. If the new mask is one of the masks you selected, use the drop-down menu to select this mask.
- Click OK.
- Click OK.
|
Recode masks as blanks (NULLs)
|
- Select the masks you want to recode as blanks (NULLs).
To select all the masks in the list, right-click and select Select All.
- Right-click and select Empty.
|
Undo applied recodes
|
- Select those masks you want to undo.
To select all masks, right-click and select Select All.
- Right-click and select Original.
|
-
Click OK.
Two new columns are added to the attribute's metadata:
-
Recoding Mask. Recodes for masks display. If the mask has not been recoded, the original mask is shown.
-
Mask Recoded? If the mask shown in the Recoded Mask column is a recode, this column will display Yes, otherwise the value is blank.