rlookup_with_null
Relational functions rlookup_with_null
syntax
- rlookup_with_null(foreign_key, target_values)
definition
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.
example
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]
value info
Because a null foreign_key value can match here, the [[value info]] dialog also reports no row of the searched attribute has this value for a null key, when target_values holds no null entry. In rlookup(relational function) that case is left unreported, since there a null key never matches and the dialog already shows it as null. (since 20.16.0)