-
1. Re: Comma separated filter
Ken Flerlage Jun 19, 2019 9:05 AM (in response to Dylan Wood)You're trying to generate a list of potential values for the filter. I get that, but it won't work like this. The IF statement will stop as soon as a criteria is met. So, between your 3 records, all of them contain either cinnamon or milk, so one of the first two criterion is met and the if statement stops. In order to get individual values, you are going to need to have a data set large enough where you can guarantee that at least criteria is met at least once. But, even if you did that, this isn't going to work as you expect it to. Each row will only have one value for "Ingredients Filter" and that will be the first criteria it meets. For example, Chill will meet the Cinnamon criteria only so that will only have one value.
To make this work, you're going to need to break out each ingredient into a separate record. So, for example, French Toast will have four records--1 for each of the ingredients. If, by some chance, nothing has more than 10 ingredients, then you could use Tableau Prep to split the values then do a Pivot step. Here's how to do that: https://interworks.com/blog/kwagner/2018/12/27/split-and-pivot-your-data-with-tableau-prep/
-
2. Re: Comma separated filter
Rodrigo Calloni Jun 19, 2019 10:41 AM (in response to Dylan Wood)Hi Dylan
I have a very similar use case and you could use a parameter in combination with a CONTAINS check to achieve your filtering.
So first create a simple String parameter and leave it empty.
Then Create a calculated field like this:
CONTAINS(LOWER([Ingredients]),LOWER([Paramater]))
To finish, place the calculated field in the Filter shelf and pick TRUE.
Now show your paramater. If an user types MILK, tableau will retrieve the 3 records you want. If they type Salt, then only first row will show up.
Note: this solution is similar to creating a Wildcard filter, but I find it to me more resource efficient.
Keep vizzing
Rodrig -
3. Re: Comma separated filter
Ken Flerlage Jun 19, 2019 10:55 AM (in response to Rodrigo Calloni)This won't allow multi-selecting the options though. You'll only be able to see one component at a time.
-
4. Re: Comma separated filter
Dylan Wood Jun 19, 2019 11:21 AM (in response to Rodrigo Calloni)Thanks Ken.
Ya I actually tried this after finding it elsewhere, but I need to be select multiple values through a drop down. So once I use my actual data, I can allow my users to pick and choose (mix and match) which ingredients they want to see recipes for.
-
5. Re: Comma separated filter
Dylan Wood Jun 19, 2019 5:43 PM (in response to Ken Flerlage)Thanks Ken,
Is there a different method entirely that could recommend?
-
6. Re: Comma separated filter
Rodrigo Calloni Jun 19, 2019 5:34 PM (in response to Ken Flerlage)Yes Ken is right (as always), you can't multi-select with this solution.
Rodrigo
-
7. Re: Comma separated filter
Peter Fakan Jun 19, 2019 6:11 PM (in response to Dylan Wood)Hi Dylan,
Just thinking aloud picking up on your different method entirely comment, have you thought about having each ingredient as a column and then maybe have a series of parameters that just do the equivalent of a true/false display on it ?
i.e. I'm thinking of maybe 5 parameters where you select Milk, eggs, sugar, maple syrup and flour and the list will filter itself down to pancakes.
HTH
Peter
-
8. Re: Comma separated filter
Ken Flerlage Jun 20, 2019 7:17 AM (in response to Dylan Wood)I'd recommend having each ingredient on its own row.
