The MapSubstring script function is used to map parts of any expression to a previously loaded mapping table. The mapping is case sensitive and non-iterative, and substrings are mapped from left to right.
Return data type: string
The name of a mapping table previously read by a mapping load or a mapping select statement. The name must be enclosed by single straight quotation marks.
Warning noteIf you use this function in a macro expanded variable and refer to a mapping table that does not exist, the function call fails and a field is not created.
|The expression whose result is to be mapped by substrings.
In this example we load a list of product models. Each model has a set of attributes that are described by a composite code. Using the mapping table with MapSubstring, we can expand the attribute codes to a description.
The resulting table looks like this:
|Red Cotton Small
|Blue Polyester Large
|Yellow Polyester Medium
|Red Cotton Large
|Red Cotton Large with hood
|Blue Cotton with patch
|Red Yellow Blue Cotton Small/Medium/Large