Hi, if I interpret your question correctly, you want a YES in table A whenever the e-mail or ID appears in B, regardless of the location in which these appear in table B. If so, this will do:
Names Default To Here(1);
dtA = datatable("tableA");
dtb = datatable("tableB");
//make lists of IDs and emails in table B
bIDs = dtB:ID << get values;
bEmails = dtB:email << get values;
//use formula to check if anything in the given row of A occurs anywhere in B
dtA << new column("bMatch", character, formula(if(contains(bIDs, :ID) | contains(bEmails, :email), "YES", "")));
dtA:bMatch << Delete Formula;
Here is sample output:
![brady_brady_0-1615428671490.png brady_brady_0-1615428671490.png](https://community.jmp.com/t5/image/serverpage/image-id/31157i9A52BF0F2CB5BB30/image-size/large?v=v2&px=999)
Cheers,
Brady