APPLY_MASK_NUMERIC Function
Description: Applies a mask at data normalization time for both inbound and outbound normalization. The field mask is processed from right to left. Any leading sign or decimal point is ignored. Field mask processing is done first during inbound normalization where a field mask of Y means to include the position for normalization and N means not to include the position. During outbound normalization, the field mask is processed last when the disguised value is being returned to the source field where a field mask of Y means to return a value to that position from the disguised value and N means leave the original value in that position. This function applies specifically to numbers. It masks the numeric value with the specified mask key.
Parameters: String, String
- Source: The string containing the source value, which is a number.
- Mask key: The mask is the sequence of characters that specify the mask (Y, N, space) identifying which digits are to be returned. "Y" specifies to return the digit at this location. "N" specifies to omit the digit at this location. The length of the field mask may be different than the length of the source value. If the field mask is longer than the source value provided, the source value will be padded with zeros to the length of the mask and the digits marked Y will be returned. If the field mask is shorter than the length of the source value, the mask value will be padded to the length of the source value based on the following:
- If the field mask contains only Y values, all digits beyond the length of the mask will be treated as N and will not be returned.
- If the field mask contains a mixture of Y and N values, all digits beyond the length of the mask will be treated as N and will not be returned.
- If the field mask contains only N values, all digits beyond the length of the mask will be treated as Y and will be returned.
Return: String containing the digits that correspond to the selected field mask characters.
Syntax: APPLY_MASK_NUMERIC (<source>,<mask key>)
Example: Apply a field mask to the Phone data element to return only the last four digits. In this example, the phone number is always all numbers but may or may not include the area code.
( APPLY_MASK_NUMERIC( DE("Phone").getOriginalValue( ), "YYYY") )
{{export-indexterm primary="APPLY_MASK_NUMERIC function"/}}