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! Go to 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), ",")))
)
)
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), ",")))
)
)
User | Count |
---|---|
17 | |
12 | |
9 | |
4 | |
4 |