Slice row filter w/ enumlist

A new appsheet user. I have successfully created slices with row filters using enum type column. The row filter was like ANY(tablename1[column1])=[column a]. In the successful cases column1 was a enum. I can’t write a row filter for a column that is enumlist (multiple values). I understand ANY selects only 1value. So what row filter expression would work for an enumlist type column.

@mvp
You can use

CONTAINS({"Your", "values", "here"},[EnumlistColumnName])
1 Like

Thanks very much. Works great. I had not found the CONTAINS function.

Hi,

It’s not clear for me this CONTAINS() function since the values in curly brackets {“Your”, “values”, “here”} are not automated.

I’m having the same problem as Dan, I achieved doing a slice row filter with Enum like this app sample:

https://www.appsheet.com/samples/Allow-the-user-to-filter-a-view-based-on-a-form?appGuidString=91266cff-e843-46b8-a42b-3d85afedb37f

When I change in Data >> Columns >> “Filter” Table, the “Color” column to Enumlist, the filter works (I’m able to select “Blue” and “Red” at the same time), but the chart does NOT correspond to the selection.

Therefore, I believe it’s a problem in the Slices >> “Filtered Data” >> Row filter condition =
ANY(Filter[Color]) = [Color]

I tried putting the following Row filter condition instead, but it still doesn’t work:
CONTAINS(ANY(Filter[Color]) = [Color],[Color])

Hope someone can help me making it more automated instead of stating each of the desired values.

Thanks!

I’ve checked on AppSheet community and I still didn’t succeed to achieve this feature, I’m sure it is an expression detail that I’m not getting right.

Here is another trial with the following expression, but the bar chart is counting wrong:
CONTAINS(ANY(Filter[Color]), LIST([Color]))

Here is what I am trying to get it, but as you can see the expression is not automated, so if select only “Blue” it will still count both colors on the chart
CONTAINS({“Blue”, “Red”},[Color])

Obs.: My “Color” column in “Filter” table, i.e. Filter[Color] is a EnumList, which is working fine and I’m not using “Interactive mode” on the dashboard View or a Ref (referenced column) because I guess is just a filter on the Slice I’m current in (picture above).

Many thanks!

Hi @Steve,

I tried this:
IN(ANY(Filter[Color]), LIST([Color]))
or
IN(ANY(Filter[Color]), LIST(Data[Color]))

But it still doesn’t work correctly.

The expression ANY(Filter[Color]) keeps change dynamically as I select the buttons “Red” and “Blue” together, which is good because it automates the app, like this picture:

For instance, this expression looks to work correctly:
CONTAINS(ANY(Filter[Color]), LIST([Color]))

When I check on “Test” it gives these results (=TRUE), but the chart does not sum correctly:

However, as I did in the previous comment, when I write:
CONTAINS({“Blue”, “Red”}, LIST([Color])) or CONTAINS({“Blue”, “Red”}, [Color])
the chart sums correctly both Blue and Red.

Isn’t that weird?

Did you look at the doc?

Great, I found the solution!

It was more simple than what I imagined.

Basically, the expression/ function that I used was:

= IN([Color], Filter[Color])

I just aware everyone to keep only one row in the “Filter” Table:

Then you will be able to get the following result:

Thank you @Steve for clarifying where I was stuck in :sweat_smile:

2 Likes