rlookup_with_null - ObjectVision/GeoDMS GitHub Wiki
Relational functions rlookup_with_null
- rlookup_with_null(foreign_key, target_values)
rlookup_with_null works as rlookup(relational function), but a null foreign-key value is looked up in a null entry of target_values (as produced by e.g. unique_uint32_with_null) instead of resulting in null.
unit<uint32> D5: nrofrows = 5 { attribute<uint32> vn: [3,null,4,1,5]; }
unit<uint32> uqn := unique_uint32_with_null(D5/vn); // values: [null,1,3,4,5]
attribute<uint32> rlk (D5) := rlookup(D5/vn, uqn/values); // [2,null,3,1,4]
attribute<uint32> rlkn (D5) := rlookup_with_null(D5/vn, uqn/values); // [2,0,3,1,4]