Hello everyone,
I have an ARRAY with alphabetical values in a structure formula.
And I have a second ARRAY, also with alphabetical values. Both ARRAYs are sorted.
I want to output the values from the first ARRAY that are not contained in the second ARRAY.
Something like that:
WITH A = ARRAY("One","Two","Three") :
WITH B = ARRAY("One","Three") :
WITHOUT(A, B)
result -> One, Two, Three
I expect -> Two
The WITHOUT function unfortunately only allows one value.
Is there any solution for my problem?
BR,
Toni
Hello @Toni Strauchfuss
You can use a formula like this for comparing two arrays and returning the difference between them:
with Array1 = ARRAY(...):
with Array2 = ARRAY(...):
Array1.FILTER(x -> !Array2.CONTAINS(x)).JOIN(", ")
I hope this helps. If you need further assistance with the formula or if you have other questions about Structure, please reach out to us directly at our support portal.
Best regards,
Stepan
Tempo (the Structure app vendor)
You are my SUPER-HERO today! 👍🏿
Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am not sure, but would this work?
FILTER(A, item -> NOT(IN_ARRAY(B, item)))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IN_ARRAY is unknown on my Jira instance but that script also works:
WITH A = ARRAY("One","Two","Three") :Thanks Tuncay.
WITH B = ARRAY("One","Three") :
A.Filter(x -> NOT(CONTAINS(MERGE_ARRAYS(B),x)))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aaah yes, it is CONTAINS not IN_ARRAY
thanks for correcting
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.