# tRecordMatching

Ensures the data quality of any source data against a reference data source.

tRecordMatching joins two tables by doing a fuzzy match on several columns using a wide variety of comparison algorithms. It compares columns from the main flow with reference columns from the lookup flow and according to the matching strategy you define, outputs the match data, the possible match data and the rejected data. On arranging your matching strategy, the user-defined matching scores are critical to determine the match level of the data of interest.

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## tRecordMatching Standard properties

These properties are used to configure tRecordMatching running in the Standard Job framework.

The Standard tRecordMatching component belongs to the Data Quality family.

This component is available in Talend Data Management Platform, Talend Big Data Platform, Talend Real-Time Big Data Platform, Talend Data Services Platform and in Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit<br>schema | <ul> <li> <p>A schema is a row description, it defines the number of fields to be                            processed and passed on to the next component. The schema is either                                <span>Built-in</span> or stored remotely in the                                <span>Repository</span>.</p> </li> <li> <p> <span>Built-in</span>: You create and store the schema                     locally for this component only. For more information about a component schema                     in its <span>Basic settings</span> tab, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/basic-settings-tab" target="_blank">Basic settings tab</a>.</p> </li> <li> <p> <span>Repository</span>: You have already created and                     stored the schema in the Repository. You can reuse it in other projects and Job                     designs. For more information about a component schema in its <span>Basic                        settings</span> tab, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/basic-settings-tab" target="_blank">Basic settings tab</a>.</p> </li> </ul> |
| Replace output column with lookup column if matches or<br>possible matches | Select this check box to replace the output column with the lookup<br>column in case of match or possible match values.<br><br>Once this check box is selected, the Columns<br>Mapping table appears. |
| Columns Mapping | <ul> <li> <p>Complete this table to define the output columns to be replaced and                            the corresponding substitute lookup columns. The column to be complete                            are:</p> <p>- <span>Output Column</span>: select the column of                            interest from the drop-down list. On this list, two columns                                <em>MATCHING_WEIGHT</em> and                                <em>MATCHING_DISTANCES</em>, are defined by default; the                            other columns are available only when you have defined them in the                            schema editor of this component. For further information about these two                            default columns, see <a href="https://help.qlik.com/talend/en-US/data-matching/8.0/matching-entries-using-q-grams-and-levenshtein" target="_blank">Matching entries using the Q-grams and Levenshtein		algorithms</a>;</p> <p>- <span>Lookup Column</span>: select the column of                            interest from the drop-down list. This list is available when a lookup                            link has been defined to provide the corresponding lookup columns to                            this component.</p> </li> <li> <p>Click the import icon to select a match rule from the <span>Talend Studio</span> repository.</p> <p>When you click the import icon, a <span>Match Rule Selector</span> wizard is opened to help you import match                     rules from the <span>Talend Studio</span> repository and use them in your Job.</p> <p>You can import rules created with the VSR algorithm. The T-Swoosh                            algorithm does not work with this component. For further information                            about importing VSR rules, see <a href="https://help.qlik.com/talend/en-US/data-matching/8.0/importing-match-rules-from-studio-repository" target="_blank">Importing match rules from the         repository</a> </p> </li> </ul> |
| Input Key Attribute | Select the columns from the main flow that needs to be checked<br>against the reference (lookup) key column.<br><br>Information noteNote: When you select a date column on which to apply an algorithm or a matching<br>algorithm, you can decide what to compare in the date format.<br><br>For example,<br>if you want to only compare the year in the date, in the component schema set the type<br>of the date column to Date and then enter "*yyyy*" in the Date Pattern field.<br>The component then converts the date format to a string according to the pattern defined<br>in the schema before starting a string comparison. |
| Lookup Key Attribute | Select the lookup key columns that you will use as a reference against<br>which to compare the columns from the input flow. |
| Matching Function | Select the relevant matching algorithm from the list:<br><br><br>Exact Match: matches each processed<br>entry to all possible reference entries with exactly the same<br>value.<br><br><br>Levenshtein: Based on the edit distance<br>theory. It calculates the number of insertion, deletion, or substitution<br>required for an entry to match the reference entry.<br><br><br>Metaphone: Based on a phonetic<br>algorithm for indexing entries by their pronunciation. It first loads<br>the phonetics of all entries of the lookup reference and checks all<br>entries of the main flow against the entries of the reference<br>flow.<br><br><br>Double Metaphone: a new version of<br>the Metaphone phonetic algorithm, that produces more accurate results<br>than the original algorithm. It can return both a primary and a<br>secondary code for a string. This accounts for some ambiguous cases as<br>well as for multiple variants of surnames with common ancestry.<br><br><br>Exact - ignore case: matches each<br>processed entry to all possible reference entries with exactly the same<br>value while ignoring the value case.<br><br><br>Soundex: matches processed entries<br>according to a standard English phonetic algorithm.<br><br><br>Soundex FR: matches processed entries<br>according to a standard French phonetic algorithm.<br><br><br>Jaro: matches processed entries<br>according to spelling deviations.<br><br><br>q-grams: matches processed entries by<br>dividing strings into letter blocks of length q in order to<br>create a number of q length grams. The matching result is<br>given as the number of q-gram matches over possible q-grams.<br><br><br>Hamming: calculates the minimum<br>number of substitutions required to transform one string into another<br>string having the same length. For example, the Hamming distance between<br>"masking" and "pairing" is 3.<br><br><br>custom...: enables you to load an<br>external matching algorithm from a Java library. The Custom Matcher column alongside is activated<br>when you selected this option.<br><br>For further information about how to load an external Java library,<br>see [tLibraryLoad](https://help.qlik.com/talend/en-US/components/8.0/library-import/tlibraryload). |
| Custom Matcher | <ul> <li> <p>Type in the path pointing to the custom class (external matching                            algorithm) you need to use. This path is defined by yourself in the                            library file (<em>.jar</em> file) which you can import by                            using the <span>tLibraryLoad</span> component.</p> <p>For further information, see <a href="https://help.qlik.com/talend/en-US/data-matching/8.0/creating-custom-matching-algorithm" target="_blank">Creating a custom matching algorithm</a>.</p> </li> <li> <p> <span>Tokenized measure</span> </p> <p>Tokenization is the concept of splitting a string into words. Select                            the method to use to compute a tokenized measure for the selected                            algorithm:</p> <p> <span> NO</span>: no tokenization method is used                            on the string. With this option, "John Doe" and "Jon Doe" should                            match.</p> <p> <span>Same place</span>: Splits the two strings by                     words to two lists, list1, and list2. Associates each element from list1 with                     the element which has the same position in list2. Using this method, "She is                     red and he is pink" and "Catherine is red and he is pink" should match.</p> <p> <span>Same order</span>: Splits the two strings by                     words to two lists, list1, and list2 and assumes that list1 is shorter than                     list2. Tries to associates the elements from list1 with the elements in list2                     taken in the same order. Using this method, "John Doe" and "John B. Doe"                     match.</p> <p>This method should be used only with strings which has a few words,                            otherwise the number of possible combinations can be large.</p> <p> <span>Any order</span>: Splits the two strings by                     words to two lists, list1 and list2, and assumes that list1 is shorter than                     list2. Tries to assign each word of list1 to a word of list2, in order to have                     the highest global similarity (with respect to the used similarity).</p> <p>Using this method, "John Doe" and "Doe John" match.</p> </li> </ul> |
| Weight | Set a numerical weight for each attribute (column) of the key<br>definition. The values can be anything &gt;= 0. |
| Handle Null | Handle Null<br><br>To handle null values, select from the list the null operator you want<br>to use on the column:<br><br><br>Null Match Null: a Null attribute<br>only matches another Null attribute.<br><br><br>Null Match None: a Null attribute<br>never matches another attribute.<br><br><br>Null Match All: a Null attribute<br>matches any other value of an attribute.<br><br>For example, if there are two columns, *name* and *firstname* where the name is never null,<br>but the first name can be null.<br><br>If there are two records:<br><br>"Doe", "John"<br><br>"Doe", ""<br><br>Depending on the operator you choose, these two records may or may not<br>match:<br><br><br>Null Match Null: they do not<br>match.<br><br><br>Null Match None: they do not<br>match.<br><br><br>Null Match All: they match.<br><br>And for the records:<br><br>"Doe", ""<br><br>"Doe", ""<br><br><br>Null Match Null: they match.<br><br><br>Null Match None: they do not<br>match.<br><br><br>Null Match All: they match. |
| Input Column | If required, select the columns from the input flow according<br>to which you want to partition the processed data in blocks, this is usually<br>referred to as "blocking".<br><br>Blocking reduces the number of pairs of records that needs to<br>be examined. In blocking, input data is partitioned into exhaustive blocks<br>designed to increase the proportion of matches observed while decreasing the<br>number of pairs to compare. Comparisons are restricted to record pairs in each<br>block.<br><br>Using blocking columns is very useful when you are processing<br>very big data. |
| Matching strategy | Select the matching output that best fulfills your needs. This<br>option may be:<br><br><ul> <li> <p>All matches: this option means to output all of the                              matching and the possibly matching records.</p> </li> <li> <p>Best match: this option means to output only the                              record with the highest matching score.</p> </li> <li> <p>First match: this option means to output the first                              matching record; if no one is matching, it outputs the first possibly                              matching record.</p> </li> <li> <p>Last match: this option means to output the last                              matching record; if no one is matching, it outputs the last possibly                              matching record.</p> <p>When you arrange the matching strategy, the matching                              scores are critical. You need to define them in the <span>Possible match interval</span> fields of the                                 <span>Advanced settings</span> view. </p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Matching Algorithm | Select an algorithm from the list. Only one algorithm is available for<br>the time being<br><br><br>Simple VSR: This algorithm is based<br>on a Vector Space Retrieval method that specifies how two records may<br>match.<br><br>For further information about how to import rules based on the VSR<br>algorithm, see [Importing match rules from the<br>repository](https://help.qlik.com/talend/en-US/data-matching/8.0/importing-match-rules-from-studio-repository). |
| Possible match interval | Enter a minimum and a maximum values:<br><br><br>minimum: set the minimum record<br>distance allowed to match the reference (0 &lt;= minimum). maximum: set the maximum distance allowed to<br>match the reference (maximum &lt;=1).<br><br>For example, if you set 0.5 as the minimum value and 0.9 as the<br>maximum value, the scores equal or higher than 0.9 indicate match, the<br>scores between 0.5 excluded and 0.9 excluded indicate possible match and<br>the other scores indicate non match. |
| Store on disk | Select this check box if you want to store processed data blocks on<br>the disk to maximize system performance. |
| tStatCatcher Statistics | Select this check box to collect log data at the component<br>level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | NB\_MATCH\_LINE: the number of rows<br>matching the comparison algorithm. This is an After variable and it returns an<br>integer.<br><br><br>NB\_POSSIBLE\_MATCH\_LINE: the number of rows possibly matching the<br>comparison algorithm. This is an After variable and it returns an integer.<br><br><br>NB\_NONE\_MATCH\_LINE: the number of rows not matching the comparison<br>algorithm. This is an After variable and it returns an integer.<br><br><br>ERROR\_MESSAGE: the error message generated by the component when an<br>error occurs. This is an After variable and it returns a string. This variable functions<br>only if the Die on error check box<br>is cleared, if the component has this check<br>box.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is not startable and it requires two input components<br>and one or more output components. |