Configuring Match Codes

Before configuring match codes there are several things to consider:

Note: Some of the considerations listed may not be relevant for all solutions.

For more information on match codes, see the Matching, Linking, and Merging Components documentation here.

For more information on data profiling, see the Data Profiles section of the Data Profiling documentation here.

Configuration

  1. In System Setup, right-click the node configured to house match codes and select 'New Match Code'.

  1. In the 'Create Match Code' dialog, define an ID and name for the match code, specify an object type for which this match code applies, and click Create. Additional object types can be identified in the Match Code editor (see details below).

  1. On the new Match Code editor, navigate to the 'Match Code' tab and click the ellipsis button (…) in the 'Category' field. In the selector that appears, select a node to indicate which objects will have match codes generated.

  1. In the 'Match Code Window Size' field, specify the window size to be used by the matching algorithm.
  2. If additional object types are required, in the 'Used For Object Types' section, use the Add Object Type link and selector to identify more object types for the match code.
  3. In the 'Match Code Context' field, specify in which context to run the match code formula. This is only required if the data is dimension dependent. By default, the current context will be selected.
  4. In the 'Match Code Workspace' field, specify in which workspace to run the match code formula. By default, Main workspace will be selected.
  5. In the 'Match Code Formula Type' field, specify 'Java Script' or 'Calculated' as the format
  6. In the 'Match Code Formula' field, then click the ellipsis button (…) to open up the formula editor and add your match code formula.

Binds for Match Code Formulas

It is also possible to make use of attributes and values that are created offline, by binding them in the match code formula. This is used in cases of offline matching or matching records on import. Once inside the 'Match Code Formula' editor, open the 'Binds' flipper, and click the 'Edit Binds' button. You can declare variables and bind them to a variety of STEP elements / objects, as determined by the selected formula type.

JavaScript Match Code Formula

When using JavaScript, the current object should be bound to a variable. The ultimate goal should be to return the match code value of an object from the JavaScript. If a string is returned, it will be used as a match code value. If a JavaScript array is returned, all values in the array will be used as match code values for that object. Additional utility functions for match codes can be accessed by binding 'Matching Functions' to, for example, the context variable in JavaScript or by binding 'Lookup Table Home' to, for example, 'lth':

Method

Description

context.soundex('Stibo')

Returns the Soundex. For more information, see Text Functions in the Calculated Attributes documentation here.

context.metaphone3('Stibo')

Returns the primary value for the Metaphone 3. For more information, see Text Functions in the Calculated Attributes documentation here.

context.metaphone3alternate('Stibo')

Returns the alternate value for the Metaphone 3. For more information, see Text Functions in the Calculated Attributes documentation here.

lth.getLookupTableValue('<asset-id>', 'LookupValue')

For more information, see the Transformation Lookup Tables topic in the System Setup / Super User Guide here.

Calculated Attribute Match Code Formula

When defining the formula via the calculated attribute language, all functions are available. An object's match code value can be a single string derived from the value of the formula, or it can be a list where all the values in the list are used as match code values for that object.

Below is an example of a simple STEP Function:

The Match Code value for each object will be a concatenation of the value for a "Manufacturer" Attribute, the string ":" and the value for a "ManufacturerPartNumber" Attribute. The Manufacturer value is normalized via a Transformation Lookup Table with ID "ManufacturerNormalization".

concatenate(
    replacevaluebylookup("ManufacturerNormalization", value("Manufacturer")),
    ":",
    value("ManufacturerPartNumber")
)

If instead you wanted to return two Match Code values for each object, one for the Manufacturer and one for Manufacturer Part Number, each prefixed with either "MAN-" or "MPN-" could be done as follows (this example is without any normalization):

listconcatenate(
    concatenate("MAN-", value("Manufacturer")),
    concatenate("MPN-", value("ManufacturerPartNumber"))
)

The reason for adding a prefix is to avoid comparing objects where their Match Code values are from completely different domains, where at all possible.

Notice that in the examples above only rudimentary normalization is applied and nothing is done to handle cases where values are missing. Since we would typically not want Match Code values only consisting of the hardcoded prefixes, below shows how checks for empty values could be added to the last example:

{
    man:= value("Manufacturer"),
    mpn:= value("ManufacturerPartNumber")
}
listconcatenate(
    if(len(man)!=0, concatenate("MAN-", man), ""),
    if(len(mpn)!=0, concatenate("MPN-", mpn), "")
)

For more information on the available STEP functions, see the Calculated Attribute Functions section of the System Setup / Super User Guide documentation here.

2018, Stibo Systems