SELECT expression

Hi,

I have a main table with an expression in a VC to return a list of email addresses if a value in the main table (District) column appears in another table, possibly more than once.

The second table has user emails ([User Id]and each user Id has an enumlist column with Districts in associated with it.

Main table has a column Called District and the value for the first row is “Bravo”.

I need the expression to return hilary@listersbrewery.com, sari@listersbrewery.com phil@listersbrewery.com bonnie@listersbrewery.com

as they all have bravo in their [Districts] column

Second table is called Second Table

User Id Districts
hilary@listersbrewery.com

Bravo , Bravo2 , Hotel , November , November2 , India , Papa , Tango , Tango2 , Victor , Whiskey

sari@listersbrewery.com

Alpha , Alpha2 , Bravo , Charlie , Charlie2 , Delta , Delta2 , November , Oscar , Oscar2 , Sierra , Sierra2 , Tango

cathy@listersbrewery.com Hotel
phil@listersbrewery.com Alpha , Bravo
ali@listersbrewery.com Foxtrot
debbie@listersbrewery.com

Uniform , Uniform2 , XRay , XRay2 , Zulu , Zulu2 , Echo Foxtrot , Echo Foxtrot2 , Foxtrot Golf , Foxtrot Golf2

bonnie@listersbrewery.com Bravo
rozalinde@listersbrewery.com 0

below is the expression that I can’t get to work.

SELECT(Second Table[User Id], IN(District ],SPLIT(LIST([Districts]), “,”)))

Thanks

Phil

FILTER(
  Second Table,
  IN(
    [_THISROW].[DISTRICT],
    [DISTRICT]
  )
)
1 Like

Thank you - that works and give the correct UNIQUE ID - how do I get the coresponding User ID values?

Thanks

This is the table structure

Unique Id User Id Districts
9E3F3C3B hilary@listersbrewery.com

Bravo , Bravo2 , Hotel , November , November2 , India , Papa , Tango , Tango2 , Victor , Whiskey

D57BEAE8 sari@listersbrewery.com

Alpha , Alpha2 , Bravo , Charlie , Charlie2 , Delta , Delta2 , November , Oscar , Oscar2 , Sierra , Sierra2 , Tango

C0F51F56 cathy@listersbrewery.com Hotel
848C2D06 phil@listersbrewery.com Alpha , Bravo
A9FF6999 ali@listersbrewery.com Foxtrot
62AAC76D debbie@listersbrewery.com

Uniform , Uniform2 , XRay , XRay2 , Zulu , Zulu2 , Echo Foxtrot , Echo Foxtrot2 , Foxtrot Golf , Foxtrot Golf2

80F40C32 bonnie@listersbrewery.com Bravo


rozalinde@listersbrewery.com

1 Like

This Works

SELECT(Second Table[User Id], IN([Unique Id],

FILTER(
User Assign Alpha,
IN(
[_THISROW].[District ],
[Districts]
)
)))

1 Like

That makes little sense to me but, in this case:

SELECT(
  Second Table[User Id],
  IN(
    [_THISROW].[DISTRICT],
    [DISTRICT]
  )
)