3 Replies Latest reply on Sep 27, 2016 3:38 AM by Kashish Chauhan

# Filter for "this", "that" or "both"

I thought this was going to be easy, but either it's not easy or I'm WAY overthinking this

I've attached a super simple example of what I'm trying to do. Basically there is a list of orders, on each order a person can have bought just apples, just oranges, or both apples and oranges. I want a filter set up to where if "Apples" is chosen it shows all the orders that contain Apples even if it contains both apples and oranges. If I select "Oranges" i want it to show all orders that contain oranges even if it contains apples as well. Historically, it's been set up to where a user would have to choose "apples" and "both" in order to see all orders containing apples and that's confusing to the users.

In the attached example, the desired results are a filter that says

(All)

Apples

Oranges

If "All" is selected, the sheet should say 3

If "Apples" is selected, the sheet should say 2

If "Oranges" is selected, the sheet should say 2.

Thanks in advance for any assistance.

• ###### 1. Re: Filter for "this", "that" or "both"

Hi Jeremy,

Please find the attached file which gives 2 in the sheet if u select 'apples' (or) 'oranges' and 3 if u select 'Both/All'

1 of 1 people found this helpful
• ###### 2. Re: Filter for "this", "that" or "both"

create a parameter with 3 values Apples,Oranges,both.

Create a calculation like this.

IF [Parameter 1]='Both' OR [Type]='Both' OR [Type]=[Parameter 1] THEN 1

ELSE 0

END

take sum of this calculation as your value , it will give you the desired result but as everyone know we will have some limitations with parameter as it is static.

• ###### 3. Re: Filter for "this", "that" or "both"

Hi Jeremy,

Here is the solution.