Hey there! Trying to make a slice for a dashboard filter.
The column in the filter table is an Enum list. Trying to search a selection of user selected genres against a table of bands whoโs [Genre] Column contains the previously mentioned Filter Table[Genres]
My slice expression is:
CONTAINS([Genre],Any(Filter Table[Genre]))
It works, but wonโt register more than one selection? it ignores everything after the comma/ delimiterโฆ
Is there a function similar to ANY() which allows multiple selection, as ANY() only allows ONE selection from a list of many? Or a means for the CONTAINS() Function to consider all of the selected Enumlist options? I need a Selection of Many from a Selection of One OR Many if possibleโฆ
I tried turning the string into a list with:
CONTAINS([Genre],SPLIT(Filter Table[Genre],","))
But that did not work eitherโฆ I also searched through the forum for a similar issue to no availโฆ
Would anyone have any suggestions?
Solved! Go to Solution.
Ok, so that is probably where weโre stuck.
Based off of the screenshots, EnumList currently wonโt work, because (and Iโm guessing here) that Iโm willing to bet that since there isnโt one standard delimiter to work with, only certain bands have their genres breaking into their individual values and other times where the genre is being stored as one whole string. This was one of the problems you were going to run into in that I mentioned earlier.
Now, that isnโt to say that EnumList isnโt going to be the plan though. It just needs to be standardized on both sides in order to work. However, as you have mentioned, itโs going to be a lot of work to standardize all of it.
So here is what I would do.
First, clone the app as it is right now as Version 2. This will where you can work on the hard part. More on that later.
On version 1, switch the bandโs Genre to Text. From what I see, a majority of the bands used either commas or slashes to delineate. Then change the expression to
OR(CONTAINS([Genre], INDEX(Filter Table[Genre], 1)), CONTAINS([Genre], INDEX(Filter Table[Genre], 2)), CONTAINS([Genre], INDEX(Filter Table[Genre], 3)), {.....})
The {โฆ} part you can delete or use that space to keep going with the expression. I would choose a maximum number of filters (maybe 3 or 5 sounds reasonable), and then come up with a message somewhere to users that only the first X selections will actually be filtered. Let me know if that works temporarily.
Version 2:
A new table consisting of just genre options. 1 genre per line. And I would stick to the most easily recognizable ones and not ones where people go โwtf does this even mean?โ Then both genre columns can be EnumList of base Ref pointing to the new table. Both of these Valid_Ifs would also be just [Genre]. That will ensure both the filter list and the bandโs listed genreโs will be from the same data. By default, AppSheet wonโt do anything with it until you attempt to edit the band, at which point it will yell at your about the genreโs not being valid and wonโt let you save it. Then your expression would be
OR(IN(INDEX(Filter Table[Genre], 1), [Genre]), IN(INDEX(Filter Table[Genre], 2), [Genre]), IN(INDEX(Filter Table[Genre], 3), [Genre]), {.....})
User | Count |
---|---|
43 | |
30 | |
24 | |
23 | |
13 |