You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.
IFUNKNOWN
Alternative notation of the ISUNKNOWN function, which increases readability especially for long expressions. This function replaces a value if that value is unknown.
The IFUNKNOWN function takes precedence over any other binary operator (except for the "NOT" operator). For example, this means that the expression A.B AND C.D IFUNKNOWN FALSE will be interpreted as A.B AND (C.D IFUNKNOWN FALSE). You can use parentheses to influence this behavior, e.g. by writing (A.B AND C.D) IFUNKNOWN FALSE. For the "NOT" operator the following expression "X AND NOT B IFUNKNOWN FALSE", can also be read as "X AND ((NOT B) IFUNKNOWN FALSE)"
Syntax
expression IFUNKNOWN value
Inputs
expression- Expression of which the value has to be returned if that value is known.
value - Value to return if the expression value is unknown.
Return type
any type, equals the expression type
Examples
Suppose the following data model.
Person.name | Person.SequenceNumber | Person.HasDrivingLicense |
---|---|---|
“Bob” | 654 | true |
“Jane” | ? | true |
“Mary” | 667 | false |
“Rick” | ? | ? |
“Ron” | ? | false |
“Jenny” | 765 | true |
? | 111 | true |
Active Person | Expression | Result | Type |
---|---|---|---|
Jane - ? - true | Person.SequenceNumber IFUNKNOWN 999 | 999 | Integer |
Mary - 667 - false | Person.SequenceNumber IFUNKNOWN 999 | 667 | Integer |
? - 111 - true | Person.Name IFUNKNOWN "customer" | "customer" | String |
"Rick" - ? - ? | NOT Person.HasDrivingLicense IFUNKNOWN false | false | Boolean |
Both parameters of the IFUNKNOWN
function must be of the same datatype. If they differ in datatype, you get this validation error in studio:
Could not find function: IFUNKNOWN matching arguments System.Collections.ArrayList