Find Closest Adv
The Find Closest Adv macro finds the closest Right records for each Left record using either latitude/longitude or spatial data. It includes options for number of records to find, distance limit, and distance units. You may also filter matches using optional area fields.
Find Closest Adv macro configuration parameters
The Find Closest Adv macro has a single set of configuration parameters:
Left fields
Left record ID | Required. Field containing unique record identifier from left input table. Default: Blank. |
Left latitude | Required if Left spatial is not defined. Field from left input table containing latitude. Default: Blank |
Left longitude | Required if Left spatial is not defined. Field from left input table containing longitude. Default: Blank |
Left spatial | Required if Left latitude/longitude are not defined. Field from left input table containing spatial data. Default: Blank |
Right fields
Right record ID | Required. Field containing unique record identifier from left input table. Default: Blank. |
Right latitude | Required if Right spatial is not defined. Field from left input table containing latitude. Default: Blank. |
Right longitude | Required if Right spatial is not defined. Field from left input table containing longitude. Default: Blank. |
Right spatial | Required if Right latitude/longitude are not defined. Field from left input table containing spatial data. Default: Blank. |
Setting
Top N | Optional. Number of matching right records to find, ranked by proximity. Default: 1. |
Distance limit | Optional. Limit matching records to those within defined distance. Default: Blank. |
Unit | Required. Unit of measurement, either KM (kilometers) or MI (miles). Default: KM. |
Restrict match by area
Right area field | Optional. Fields from left and right input tables used to limit matches to specified area. In practice, this means that left and right fields must join on these key fields to match. Default: Blank. |
Configure the Find Closest Adv macro
Select the Find Closest Adv icon, and then select the Configuration tab on the Properties pane.
Define left and right input fields:
Select Left Record ID and select the field containing the unique record ID for the left input table.
Select either Left Latitude and Left Longitude or Left Spatial, and select the left spatial data input fields.
Select Right Record ID and select the field containing the unique record ID for the right input table.
Select either Right Latitude and Right Longitude or Right Spatial, and select the right spatial data input fields.
Optionally, configure Settings:
Select Top N and specify the number of matches to return, ranked by proximity.
Select Distance Limit and specify the maximum distance for matching records.
Select Unit and select the unit of measurement, either KM (kilometers) or MI (miles).
Optionally, Restrict match by area:
Select Left Area field and Right Area field and select fields (such as STATE) that limit matches to a specified area. The left and right fields must match in order to return the closest Right records for each Left record.
Optionally, go to the Execution tab, and then set Web service options.