Slice row filter w/ enumlist

mvp
New Member

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.

Solved Solved
0 8 2,758
1 ACCEPTED SOLUTION

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

View solution in original post

8 REPLIES 8

@mvp
You can use

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

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

edulk
New Member

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=91266...

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!

edulk
New Member

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

Top Labels in this Space