Let's say I have the following two lists:
x : `a`b`c`d;
y : `a`b`e`f;
For the intersection, there is the inter operator:
q)x inter y
`a`b
Is there a similar operator to do the EXCLUSIVE OR such that I would get:
q)x outer y
`c`d`e`f
?
the operation except will give you elements of one list that do not belong in another.
However in your case x except y would only give `c`d and y except x would only give `e`f.
Therefore you could use either;
q)(x except y),y except x
`c`d`e`f
or
q)(x union y) except (x inter y)
`c`d`e`f
or alternatively without using except
q)where(count each group (distinct x), distinct y)=1
`c`d`e`f
if you want to get a list of all exclusive elements.
Regards, Kevin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With