12 Replies Latest reply on Apr 28, 2016 7:48 PM by swaroop.gantela

# Multiple boolean dimensions in a single filter

Hi all,
I'm working with bibliographic data. My dataset shows books' paper type in T/F booleans, and it's possible for a book to have more than one type of paper. (In my dataset, these are the "500.2 Paper..." fields). Currently, I can build a filter for each paper type, with T/F radio buttons. But I'd like to have a single filter card with a checkbox for each paper type. This is very similar to a proposed idea https://community.tableau.com/ideas/2834#comment-19101, and another user's issue, Re: Create a filter with 19 boolean dimensions COMBINED, but I'm posting my own question here in case any solutions have been discovered since those previous posts. I really appreciate your help!

• ###### 1. Re: Multiple boolean dimensions in a single filter

Hello Blake - Just a quick thought. If you change your filter type to "Multiple Value (List)", will that work ?

Thanks,

Manideep

• ###### 2. Re: Multiple boolean dimensions in a single filter

Unfortunately, that would just include every possible value.
For example imagine 3 records:
Record 1     [500.2_Paper] = "Arches, Handmade"

[500.2 Paper 10Arches]= true

Record 2      [500.2_Paper] = "Arches"

[500.2 Paper 10Arches]= true

[500.2 Paper 10Arches]= false

Setting the filter type as "Multiple Value (List)" gives me three check-boxes

Arches

But I want just two check boxes

Arches

I don't care if this filter would work as a boolean OR or a boolean AND, but with 61 types of paper, there are too many permutations & combinations to list with the filter type "Multiple Value (List).

Thanks for you're help! I hope there's a solution!

• ###### 3. Re: Multiple boolean dimensions in a single filter

Hello Blake - Ok, do one thing .. create a group on the dimension  [500.2_Paper]

and then group the element as per the requirements

Then place that group to the filter

Hope this will solve your grouping of filter problem.

Thanks,

Manideep

• ###### 4. Re: Multiple boolean dimensions in a single filter

Unfortunately, making groups won't work because a value can only belong to one group at a time. For example, I made a group for Abaca paper and a group for Arches paper. But if I have a book that has both "Abaca, Arches," I can't seem to put it in both groups.  Maybe, I'm doing something wrong though.

Once again, I really hope there's a solution!

• ###### 5. Re: Multiple boolean dimensions in a single filter

This seems to be related.

I'll give it a shot and keep you posted.

• ###### 6. Re: Multiple boolean dimensions in a single filter

I believe that user had an identical problem, but I can't seem to replicate the solution. If you're able to repeat it yourself and post some screenshots, I'm sure i could do it!

• ###### 7. Re: Multiple boolean dimensions in a single filter

Blake,

I'm late to the discussion, and I apologize at the outset if I haven't grasped the issues at hand,

but I had the feeling that pivoting all your booleans into one column might help.

2 of 2 people found this helpful
• ###### 8. Re: Multiple boolean dimensions in a single filter

Hi Blake,

Here is a possible solution using parameters to select the paper types. Although this doesn't result in a single checkbox/selection control, it might be a way of simplifying the process depending on how many paper types might be combined or searched for at a time. Setting up the code for the filter based on the parameters could take some time since you need to account for every possible combination of parameters. Currently I have it setup with four paper types possible and a combination of any 2 can be selected. If you look at the code for the Paper Types Filter, you can see how I did this, though there might be an easier way. Again, I know this probably isn't the ideal solution that you were looking for, but it might be a step in the right direction and give someone else an idea of how to approach it.

-Marc

UPDATE: I removed the workbook from this post since I came across another way of creating the filter and attached it to another post below.

• ###### 9. Re: Multiple boolean dimensions in a single filter

UPDATE to my last post:

After looking at another question that you linked to, the following code should work for the filter instead of the long combination by combination approach I originally took:

IF [Paper Type 1]="All" then "Show"

elseif ( contains([500.2 Paper1],[Paper Type 1]) or contains([500.2 Paper1],[Paper Type 2]) ) then "Show"

end

One thing to notice though is that this ends up ignoring all of the booleans and just looks at the overall paper type field. Basically it searches the string field to see if the selected paper type is present.

This workbook contains a dashboard that shows the results based on the two different filtering approaches. From what I can tell they are working the same, so I would go with the shorter (and easier) one.

-Marc

• ###### 10. Re: Multiple boolean dimensions in a single filter

This seems to work! Fantastic! I'm going to try to pivot other values (e.g. type, materials) in addition to paper. I'll hope I can repeat this process with several pivots.

• ###### 11. Re: Multiple boolean dimensions in a single filter

This worked! Thanks!

• ###### 12. Re: Multiple boolean dimensions in a single filter

Blake,