You are viewing the documentation for Blueriq 14. 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

ExpressionResultTypeNote
( 'a' , 'b' , 'c' ) SUBSET OF ( 'a' , 'b' , 'c' , 'd' )TRUEboolean
( 'a' , 'b' , 'c' , 'd' ) SUBSET OF ( 'a' , 'b' , 'c' )FALSEboolean
Person.hobbies SUBSET OF [ "Tennis" , "Soccer" , "Music" ]
Given Person.hobbies = [ "Tennis" , "Soccer" ]
TRUEboolean
Person.hobbies SUBSET OF [ "Tennis" , "Soccer" , "Music" ]
Given Person.hobbies = [ ? ]
?boolean
Person.hobbies SUBSET OF [ "Tennis" , "Soccer" , ? ]
Given Person.hobbies = [ "Tennis" , "Soccer" ]
FALSEboolean[ "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 = ?

FALSEboolean



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.


Back to Top