Good morning
AX supports basic operations on sets, here’s a simple overwiew:
public static void OperationsOnSets(Args _args)
{
Set a = new Set(Types::Integer); //[1,3]
Set b = new Set(Types::Integer); //[2,3]
Set c = new Set(Types::Integer); //Result
;
{
Set a = new Set(Types::Integer); //[1,3]
Set b = new Set(Types::Integer); //[2,3]
Set c = new Set(Types::Integer); //Result
;
a.add(1);
a.add(3);
a.add(3);
b.add(2);
b.add(3);
b.add(3);
c = Set::union(a, b); //[1,3] U [2,3] Result: [1,2,3]
c = Set::intersection(a, b); //[1,3] ∩ [2,3] Result: [3]
c = Set::difference(a, b); //[1,3] – [2,3] Result: [1]
}
c = Set::intersection(a, b); //[1,3] ∩ [2,3] Result: [3]
c = Set::difference(a, b); //[1,3] – [2,3] Result: [1]
}