Skip to main content

Selections and Relations

A selection defines a subset of the rows in a table. A selection made in one table can be translated into a selection in another table, if the tables are related.

Row Selections

A row selection represents a subset of rows in a single table. It is a considerably simpler concept than data selection, which represents a subset of rows in all tables. Different row selections for the same table can be combined to create new row selections using set operations, such as union or the intersection of two row selections.

Relations and Table Groups

A relation defines how the rows of one table correspond to the rows of a second table. The first table is referred to as the left table and the second table as the right table. The mapping is defined using a relation expression, which has the following general form:

M1([Left.C1]) = M2([Right.C2]) AND M3([Left.C3]) = M4([Right.C4]) AND ...

The expression is the logical AND of a number of equality statements. The methods applied to the columns are typically simple operations like converting to uppercase.

Given any row in the left table, there are zero or more rows in the right table that satisfy the relation expression. It is therefore possible to define a mapping that translates a set of rows in the left table into a set of rows in the right table. And similarly, a set of rows in the right table can be translated into a set of rows in the left table. A round-trip translation, however, might yield a different set of rows than the original set, since there is not necessarily a one-to-one correspondence between the rows in the tables.

There can be at most one relation defined between two tables. Cyclic relations are not allowed. If there are several tables and relations defined between some of them, then the relations implicitly form connected groups of tables. A connected set of table is called a table group.

Relations define connected groups of tables

The table collection in the data manager keeps a table group collection where the current groups can be found. The group collection is updated dynamically as relations are added or removed.

Data Selections: Filterings, Markings and Highlights

The data selection is the base class for all selections that are applicable to the full collection of tables in an analysis. There are a handful of different selection types with subtle differences:

  • A filtering selection depends on external filters in the filter panel. When the filtering changes, the result may or may not be propagated to related tables, dependent on settings made at the relation level. The filtering may even be propagated in one direction but not the other.
  • A marking selection is based on explicit row selections made in one or more related tables. Depending on how the selection is made, the old selection may be cleared or combined with the new selection. A marking selection is always propagated to related tables.
  • A highlight selection is more transient in nature than the other selections. It is not undoable and depends completely on where the user points the cursor.
  • There are two special convenience selections: The all rows selection and the no rows selection.