A method to filter multiple data value in the same time

Hi, I'm an Appsheet newbie!

I have a data table which contents records that having multiple tag values, delimited by comma "," and end-users could be add, change or delete these tags.

Now I'm creating a filter page which end-users could be select multiple tag choice for data managed by the table before. The users' filter choice is managing by a separate filter table.

Is there a way to compare and filter data records matching users' choice? I'm now having problem with this as it's now filtered correctly with data having single tag only but not multiple.

For example, I having 4 data records

1 tag = yellow,red,blue

2 tag = violet

3 tag = blue,yellow

4 tag = grey,blue

Then if a user choice to filter record with 2 different tags "yellow,blue" on filter page (via an enum-list), I want to filter and show record 1, 3 and 4 on data result list.

If a user choice to filter record with tag "yellow" on filter page (via an enum-list), I want to filter and show record 1 and 3 only.

Please give me some advices. Thanks so much!

Solved Solved
0 4 244
1 ACCEPTED SOLUTION


@Evendo wrote:

I just wonder as I want to compare 2 different list, is it unnecessary to split enum value?


Yes.

IF(
  ISBLANK(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], (USEREMAIL() = [ใƒฆใƒผใ‚ถใƒผ]), TRUE)),
  ("่ฆ‹่พผใฟๅฎข" = [้กงๅฎข็Šถๆ…‹]),
  AND(
    ("่ฆ‹่พผใฟๅฎข" = [้กงๅฎข็Šถๆ…‹]),
    ISNOTBLANK(INTERSECT([ใ‚ฟใ‚ฐID], SPLIT(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], (USEREMAIL() = [ใƒฆใƒผใ‚ถใƒผ]), TRUE), ",")))
  )
)

View solution in original post

4 REPLIES 4

ISNOTBLANK(INTERSECT([filter ENUMLIST], [tag column]))

@TeeSee1 Thanks for your advice, I will try to apply in my app. I just wonder as I want to compare 2 different list, is it unnecessary to split enum value?

@TeeSee1 I tried to use the above command as slide's filter condition, but it returned an error like this: "INTERSECT does not accept a list of list."

In my app, both filter list and tag column is ENUMLIST.

The below is current command

IF(ISBLANK(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], [ใƒฆใƒผใ‚ถใƒผ] = USEREMAIL(), TRUE)), [้กงๅฎข็Šถๆ…‹] = "่ฆ‹่พผใฟๅฎข", AND([้กงๅฎข็Šถๆ…‹] = "่ฆ‹่พผใฟๅฎข", ISNOTBLANK(INTERSECT([ใ‚ฟใ‚ฐID], SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], [ใƒฆใƒผใ‚ถใƒผ] = USEREMAIL(), TRUE)))))

 I used another command before (as below) but it worked incorrectly in case the tag column is multiple value

IF(ISBLANK(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], [ใƒฆใƒผใ‚ถใƒผ] = USEREMAIL(), TRUE)), [้กงๅฎข็Šถๆ…‹] = "่ฆ‹่พผใฟๅฎข", AND([้กงๅฎข็Šถๆ…‹] = "่ฆ‹่พผใฟๅฎข", ISNOTBLANK([ใ‚ฟใ‚ฐID]), SPLIT(TEXT([ใ‚ฟใ‚ฐID]), ", ") = INTERSECT(SPLIT(TEXT(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], [ใƒฆใƒผใ‚ถใƒผ] = USEREMAIL(), TRUE)), ", "), SPLIT(TEXT([ใ‚ฟใ‚ฐID]), ", "))))

As I'm not familiar with compare 2 list in Appsheet, I'm so appreciate for any help. Thanks...


@Evendo wrote:

I just wonder as I want to compare 2 different list, is it unnecessary to split enum value?


Yes.

IF(
  ISBLANK(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], (USEREMAIL() = [ใƒฆใƒผใ‚ถใƒผ]), TRUE)),
  ("่ฆ‹่พผใฟๅฎข" = [้กงๅฎข็Šถๆ…‹]),
  AND(
    ("่ฆ‹่พผใฟๅฎข" = [้กงๅฎข็Šถๆ…‹]),
    ISNOTBLANK(INTERSECT([ใ‚ฟใ‚ฐID], SPLIT(SELECT(ใƒ•ใ‚ฃใƒซใ‚ฟใƒผ[ใ‚ฟใ‚ฐID_่ฆ‹่พผใฟๅฎข], (USEREMAIL() = [ใƒฆใƒผใ‚ถใƒผ]), TRUE), ",")))
  )
)
Top Labels in this Space