What function can determine whether each row of my string filed is one of values defined in a String List

I have a string filed ‘MyGroup’ with values:

A
B
C
A
B
B
C
D
D

I created a parameter ‘interestedlist’ and a text field control where users can enter a list of interested values separated by comma e.g. A,B, which they want to group as “Customized Group”

In the pivot table, I want to show comparison of Customized Group vs the rest

Customized Group
C
D

Inspired by this post, I tried the calculated field formula below but got error with split complaining interestedlist is a string list instead of string. What function I can use to tell whether my string is a substring of a “string list”?

ifelse(
    (isNotNull(split(${interestedlist},',',1))) AND ({MyGroup}==split(${interestedlist},',',1)), "Customized Group",
    (isNotNull(split(${interestedlist},',',2))) AND ({MyGroup}==split(${interestedlist},',',2)), "Customized Group",
    (isNotNull(split(${interestedlist},',',3))) AND ({MyGroup}==split(${interestedlist},',',3)), "Customized Group",
    (isNotNull(split(${interestedlist},',',4))) AND ({MyGroup}==split(${interestedlist},',',4)), "Customized Group",
    (isNotNull(split(${interestedlist},',',5))) AND ({MyGroup}==split(${interestedlist},',',5)), "Customized Group",
    {MyGroup}
)

Hi @Jing_Li
did you check

BR

1 Like