JMP for Mac
Version 17.2.0 (701896)
I have a column "Data" with rows of number_number like this:
1_3
3_7
6_5
...
I want to test this column to see if some of the rows contain values from a list of values and then flag or label the rows which do.
I know I could construct an elaborate formula like this:
If( :Die X_Y == "3_9" | :Die X_Y == "3_4",
1,
0
)
But that's very laborious for long lists of different values to check. I'd like to just be able to paste a list of values to check for in a formula, delimited by a space or comma.
I found the function "Contains Item." It works fine for one item but the help entry doesn't offer any insight on how to construct the "list" option. I tried this (specifying the optional delimiter as a space):
If( Contains Item( :Die X_Y, "3_4 3_9", " " ),
"exclude",
"not exclude"
)
and this:
If( Contains Item( :Data, "3_4,3_9", "," ),
"exclude",
"not exclude"
)
I understand the default delimiter is a comma but wanted to enforce to find anything that works. Neither Contains Item function is returning the sought-for behavior (logical 1 if there is a match, 0 if not). If there is a better function to use please advise.
This is a generalized problem I'd like to be able to solve -- inspecting a column to find matches with long lists of items.
Thanks