How should I do with the formula to get the desired result?

Hello.

When creating Form, select FormName MLB News.
The category of MLB News is Baseball and MLB.
In the Member Table, John and Nick are the people whose Interests are Baseball or MLB.
I’d like to bring John and Nick’s email list, how can I do the formula?
I tried this, but I couldn’t get the result I wanted.

select(Member[Email], in(select(Form[Category], [FormName] = “MLB News”), split([Interests], " , ")))

Please help me.
Thank you.

Solved Solved
0 6 212
1 ACCEPTED SOLUTION

Sorry, typo. Was supposed to say “some sort…”.

It is good that both are EnumLists, so you won’t need to use SPLIT(). The comparison basically just needs to be “is there any interest in common”, correct?

If so, how about we just use ISNOTBLANK() with INTERSECT()

Try this:

SELECT(
  Member[Email] ,
  ISNOTBLANK( INTERSECT( [Interests] , [_THISROW].[Category] ) )
)

View solution in original post

6 REPLIES 6

What types of columns are [Category] and [Interests]? EnumLists, or…?

Your expression will take a form more like this:

SELECT(
  Member[Email] ,
  #some-sort-of-comparison-between# [Interests] #and# [_THISROW].[Category]
)

Hello, Marc_Dillon.
[Category] and [Interests] columns are EnumLists.
I don’t understand the #sort-sort-of-comparison-between# part well.
Please explain.

Sorry, typo. Was supposed to say “some sort…”.

It is good that both are EnumLists, so you won’t need to use SPLIT(). The comparison basically just needs to be “is there any interest in common”, correct?

If so, how about we just use ISNOTBLANK() with INTERSECT()

Try this:

SELECT(
  Member[Email] ,
  ISNOTBLANK( INTERSECT( [Interests] , [_THISROW].[Category] ) )
)

Wow!
It’s been solved in a cool way to go.

SELECT(
Member[Email],
ISNOTBLANK(INTERSECT([Interests], SELECT(Form[Category], [ID] = [_THISROW].[Form])))
)

Thank you so much, Marc_Dillon.

Why are you using:

instead of just:

?

The Interests column is in the Member Table, and the Category column is in the Form Table.
"[_THISROW].[Category] "Unable find to column “Category” error occurs if you enter only this.
And when I looked again, the Category Column attribute was Enum, so when I changed it to Enum List, there was an error and I corrected it as follows.

SELECT(
Member[Email],
ISNOTBLANK(INTERSECT([Interests], SPLIT(SELECT(Form[Category], [ID] = [_THISROW].[Form]), ","))
)
Top Labels in this Space