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 208
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