Help with slice expression

The problem seems to be with the IN([TEAM line. It does NOT find the matches it should.

[TEAM_NO] from the record is always a single value.
TEAM_NO from the USERS table can have one or more values

What am I missing?

AND(
[SCOPE_NO]=10,[START_DATE]<=Today(),[END_DATE]+7>=Today(),ISNOTBLANK([TEAM_NO]),[ANSWERED]=โ€œKeep Prayingโ€,
IN([TEAM_NO], LOOKUP(USEREMAIL(), Users, USER_EMAIL, TEAM_NO))
)

The list below SEEMS to be what I want.
ALL these statements are true:
โ€ฆ1: (The value of column โ€˜SCOPE_NOโ€™) is equal to (10)
โ€ฆ2: (The value of column โ€˜START_DATEโ€™) is less than or equal to (TODAY())
โ€ฆ3: ((The value of column โ€˜END_DATEโ€™ + 7) is greater than or equal to (TODAY())
โ€ฆ4: This statement is false:
โ€ฆ(The value of column โ€˜TEAM_NOโ€™) is empty
โ€ฆ5: (The value of column โ€˜ANSWEREDโ€™) is equal to (โ€œKeep Prayingโ€)
โ€ฆ6: (The value of column โ€˜TEAM_NOโ€™) is one of the values in the list (One randomly chosen value from this list (
โ€ฆThe list of values of column โ€˜TEAM_NOโ€™
โ€ฆfrom rows of table โ€˜Usersโ€™
โ€ฆwhere this condition is true: ((The value of column โ€˜USER_EMAILโ€™) is equal to (USEREMAIL()))))

Solved Solved
0 3 109
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Try replacing the existing IN() subexpression with either of the following:

ISNOTBLANK(
  FILTER(
    "Users",
    AND(
      ([USER_EMAIL] = USEREMAIL()),
      IN([_THISROW].[TEAM_NO], [TEAM_NO])
    )
  )
)

or:

IN(
  [TEAM_NO],
  SPLIT(
    LOOKUP(
      USEREMAIL(),
      "Users",
      "USER_EMAIL",
      "TEAM_NO"
    ),
    " , "
  )
)

The problem is that LOOKUP() always produces a singular value. If the value itโ€™s asked to provide is a list, it converts the list to a single Text value that then needs to be converted back into a list to be used as a list.

View solution in original post

3 REPLIES 3

Steve
Platinum 4
Platinum 4

Try replacing the existing IN() subexpression with either of the following:

ISNOTBLANK(
  FILTER(
    "Users",
    AND(
      ([USER_EMAIL] = USEREMAIL()),
      IN([_THISROW].[TEAM_NO], [TEAM_NO])
    )
  )
)

or:

IN(
  [TEAM_NO],
  SPLIT(
    LOOKUP(
      USEREMAIL(),
      "Users",
      "USER_EMAIL",
      "TEAM_NO"
    ),
    " , "
  )
)

The problem is that LOOKUP() always produces a singular value. If the value itโ€™s asked to provide is a list, it converts the list to a single Text value that then needs to be converted back into a list to be used as a list.

Steve,

THANKS!! It works like I need it to.

Appreciate the help and the speed.

Top Labels in this Space