Skip to content

Rlookup

mtbeek32 edited this page Jan 2, 2023 · 8 revisions

Relational functions rlookup

syntax

  • rlookup(foreign_key, primary_key)

definition

rlookup(foreign_key, primary_key) results in a relation from the domain of the foreign_key argument towards the domain of the primary key argument .

applies to

description

We advise that the second argument can be used as primary key for the domain unit of this argument.

If multiple instances of the second argument occur, the resulting value will be the first index number found.

applies to

  • attributes foreign_key and primary_key with Numeric, Point, uint2, unit4, bool or string value type

conditions

The values unit of the arguments foreign_key and primary_key must match.

example

attribute Region_rel (City) := rlookup(City/RegionCode, Region/RegionCode);

City/RegionCode Region_rel
100 0
200 1
300 2
200 1
400 3
null null
400 3

domain City, nr of rows = 7

Region/RegionCode
100
200
300
400
500

domain Region, nr of rows = 5

Clone this wiki locally