A mask describes the shape of a data value based on a pattern of alphabetic and numeric characters. In certain cases, the mask also includes special characters and spaces. A mask recode is a user-defined revision, or recoding, of a mask shape which modifies or replaces all occurrences of the original mask with a new mask. You can also recode a mask to be a null (empty) value.
With mask recoding you apply global changes to data formats and structures to ensure that the resulting data values are consistent in their format and presentation. You can then export the recode tables for use in other projects. For example, the Trillium Quality Transformer process in the Control Center can use tables of recoded masks to standardize and clean data.
Recoded masks are useful, for example, if you are standardizing the way your company enters phone numbers into a database.
- 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:
- Original mask
- Recoded mask
- Example:
-
In this scenario, you want to change date formats 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 recoded mask shape in a second column. The recode table looks like this:
Original Mask
|
Recoded 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 add or edit mask recodes
-
Open a data source.
-
Click the Attribute Details tab.
-
In the Attribute Name list, select the attribute that contains the mask(s) you want to recode. A tab named for the attribute opens below the Data Source: Name panel showing an overview of the attribute's metadata.
-
On the attribute metadata tab, navigate to the Masks row and note the number of mask values. If the value is 1 or more, double-click the row. The Masks: attribute_name tab opens showing all masks in the attribute.
-
Select the masks you want to recode by clicking the check box, or anywhere in the row, to highlight it. To select multiple rows, press the Ctrl or Shift key and click the rows you want to recode. To select all rows on a page, click Select Page.
-
Click Recode. The Recoded Masks for: attribute_name window opens showing all masks you selected. The following columns display:
Column |
Description |
Original Mask |
Displays the original masked values selected for recode.
|
Frequency |
The number of times the mask occurs in the attribute.
|
Recoded Mask |
Displays either the original mask if the mask is not recoded or the recoded mask value. If the mask has been recoded, the Recoded column displays Yes.
|
Preview |
Click to see an example of the mask used in the first row of data where the mask occurs. Anytime a mask recode is changed, click to see the updated value. For example, click after recoding to see the new mask recode applied to the data.
|
Recoded |
Shows if the selected masks are recoded. Either Yes or No. If Yes, the recode value displays in the Recoded Mask column.
|
Reset |
Click to remove the mask recode value and reset it to the original mask.
|
-
To see only those masks that have previously been recoded, select Show:Saved. Otherwise, keep the default of Show: New which shows all masks you selected on the Masks tab.
-
Specify the recodes as follows:
To…
|
Action
|
Recode a single mask
|
- Click in the Recoded Mask column for the mask. The field becomes editable.
- Enter the new (recode) mask value.
- Enter the new (recode) mask value.
|
Replace multiple masks with the same mask
|
- Select the rows you want to recode. To select all rows on a page, click Select Page.
- In the Replace All with: text field, enter the new (recode) mask.
- Click Replace All.
- In the Replace All with: text field, enter the new (recode) mask.
- Click Replace All.
- Click Replace All.
|
Recode masks as blanks (null values)
|
For a single mask:
In the Recoded Mask column for the mask you want to recode as blank (null value), delete the text.
For multiple masks:
- Select the rows you want to recode as blanks (null values).
- Ensure the Replace All with: text field is blank and click Replace All.
- Ensure the Replace All with: text field is blank and click Replace All.
|
Reset (clear) a single applied recode
|
Click the reset button () for the mask you want to reset to its original mask value. The value is cleared from the Recoded Mask column for the selected mask.
Note: To reset multiple mask recodes at the same time, see step
10.
|
-
Click the Preview button () for a mask to see an example of the mask applied to the data. The example is taken from the first row of data the mask occurs.
-
To reset (clear) applied recodes for multiple masks:
-
Select the rows you want to reset. To select all rows on a page, click Select Page.
-
Click the Reset All button (). A message opens confirming the reset.
-
Click Yes. The masks are removed from the Recoded Mask column for the
selected rows.
-
Click Save to save all your recodes and edits and close the Recoded Masks window. (Click Cancel to close the Recode Masks window without saving changes.)
The Recoded Masks window closes. The Recode Mask and Mask Recode Status columns are added to the Masks: attribute_name tab,
-
(Optional) Export a mask recode look-up table to use the recodes in the Trillium Quality Transformer process in the Control Center. See Exporting Recode Look-Up Tables.