You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.
SUBSET OF
Returns TRUE
if the items in a collection are all present in another collection.
Syntax
collection1 SUBSET OF collection2
Inputs
- collection1 - The collection that is tested to be a subset of the second collection.
- collection2 - The collection that is tested to hold all the items in the first collection.
Return type
- boolean
Venn diagram
Examples
Expression | Result | Type | Note |
---|---|---|---|
( 'a' , 'b' , 'c' ) SUBSET OF ( 'a' , 'b' , 'c' , 'd' ) | TRUE | boolean | |
( 'a' , 'b' , 'c' , 'd' ) SUBSET OF ( 'a' , 'b' , 'c' ) | FALSE | boolean | |
Person.hobbies SUBSET OF [ "Tennis" , "Soccer" , "Music" ] Given Person.hobbies = [ "Tennis" , "Soccer" ] | TRUE | boolean | |
Person.hobbies SUBSET OF [ "Tennis" , "Soccer" , "Music" ] Given Person.hobbies = [ ? ] | ? | boolean | |
Person.hobbies SUBSET OF [ "Tennis" , "Soccer" , ? ] Given Person.hobbies = [ "Tennis" , "Soccer" ] | FALSE | boolean | [ "Tennis" , "Soccer" , ? ] evaluates to [ ? ] Person.hobbies SUBSET OF [ ? ] = FALSE |
( 'a' , 'b' , 'c' ) SUBSET OF ( [ 'a' , 'b' , 'c' , 'd' ] ) | Error | ||
1 SUBSET OF Address.Numbers Given Adress.Numbers = ? | FALSE | boolean |
Values between single quotes are considered value list items. For backwards compatibility reasons, a comma separated sequence of value list items is treated as a collection. That's why there is no need to enclose the values between square brackets. In fact if you do add the square brackets you create a matrix rather than a list.
Overview
Content Tools