Maptitude GISDK Help

JoinViewsMulti()

Summary

Creates a joined view by linking multiple fields in two existing views.

 

Changes

Added to Version 5.0.

 

Syntax

new_view_name = JoinViewsMulti(string joined_view_name, array left_field_specs, array right_field_specs, array options)

 

Argument

Contents

joined_view_name

A proposed name for the new joined view; can be null

left_field_specs

An array where each element is a string with the view on the left (left) side of the join and its linking field

right_field_specs

An array where each element is a string with the view on the right (right) side of the join and its linking field

 

Option

Type

Contents

A

N/A

A, for Aggregation, specifies that for each left record, the joined view aggregates all right records with a matching link field value, computing the appropriate aggregations for each field in the right view

A? or A?0

N/A

A? causes the program to take a cursory scan of the right link field values to search for repeated non-missing values. If any are found, it is treated as option A (above), otherwise it is ignored. A? lets the program make an automatic decision as to whether the right records should be aggregated, but is not precise; it does not scan all right records. A?0 does the same thing, but columns with zero values are treated as having missing values and are therefore skipped

I

N/A

I, for Inner join, indicates that the joined view does not include left records for which there are no matching right records. As a result, the joined view may have fewer records than the left view

N

N/A

N, for Near-matches, causes any left record that has no exact matching right record to match a right record with the next higher right link field value

O

N/A

O, for One-to-many, indicates that the joined view repeats left records for which there is more than one matching right record. For a left record that matches N different right records (i.e., several right records with the same link field value), the joined view has N records, all of them having the same left fields' values but different right fields' values. As a result, the joined view may have more records than the left view. This option cannot be combined with A or A?

E, L or M

N/A

At most, one of these three options may be specified. These options do not affect the resulting joined view, but each one gives advisory information that may help in using indices to sort:

 

E: Specifies that each right record matches Exactly one left record

L: Specifies that each right record matches at Least one left record (one or more left records)

M: Specifies that each right record matches at Most one left record (zero or one left records)

 

If none of these three options is specified, the program assumes that there is no information on how many left records each right record may match.

Fields

Array

A list of aggregation specifications for right fields, overriding the default aggregation rules. Each aggregation specification is a two-element array containing a right field name (string), and an aggregations array. The aggregations array is a list of rules of the same format as arrays returned by GetFieldsAggregations(). It can contain one or more of the arrays {"Sum"}, {"Max"}, {"Min"}, {"Copy"}, {"Count"}, {"Avg"}, or {"Avg", weight_field}. This will override the default aggregation rules for the fields specified in this option

 

Returns

A string indicating the name of the new joined view.

 

Notes

Example

// Link sales data by state and county to the U.S. Counties layer

view1 = JoinViewsMulti("Sales Information", {"[U.S. Counties].Name", "[U.S. Counties].County"}, {"Sales.St", "Sales.Cnty"},)

 

Error Codes

Error Type

Meaning

NotFound

Specified input views or fields do not exist

 

See Also

Function

Summary

AggregateTable()

Groups records in a view and computes summary statistics

CloseView()

Drops a view from the system

GetFieldAggregations()

Gets the aggregation rules for a field

JoinViews()

Creates a joined view by linking fields in two existing views

OpenTable()

Opens a table from a file on disk and creates a view

SelfAggregate()

Groups the records in a view, based on a field, to create an aggregate view

 

 

©2025 Caliper Corporation www.caliper.com