5 Replies Latest reply on Nov 14, 2018 7:17 AM by Akram Ebrahim

# Is it possible to use And/Or Filters?

I am trying to run a filter that calls out every variance that is -20% and +20% but at the moment I only know how to do one or the other.

I want everything <-20% and >+20%. There is an option for range of values inside (between two numbers)...but not outside.

Is this possible?

• ###### 1. Re: Is it possible to use And/Or Filters?

Hi Mike

Yes. we can use AND and OR logical operations with tableau calculated field

Ex: Ageing bin calculation

If [Age] >30 then '>30'

elseif [Age]>=20 and [Ageing]<=10 then ' 10-20'

else '<10'

end

• ###### 2. Re: Is it possible to use And/Or Filters?

Hi Mike,

Find my approach as reference below and stored in attached workbook version 2018.2 located in the original thread

1. Define Parameter Higher %

2. Define Parameter Lower %

3. Define D1. Display

[%]>[Higher %] or [%]<[Lower %]

4. Drag required objects to the indicated locations,  set filter to True and  show parameter control

Hope it helps,

Regards,

Norbert

• ###### 3. Re: Is it possible to use And/Or Filters?

how does this work on a table calculated field? i don't have a % change measure...i have a table that calculates % change based on another column

• ###### 4. Re: Is it possible to use And/Or Filters?

Mike, can you share a workbook?  Dummy up some data if needed.

This is not difficult, probably, but much depends on exactly how you're doing that "% Change" calculation.

The standard approach is to create a boolean calculated field and drop it on the Filter shelf.

Something like this:

[% Change] < -0.2 OR [% Change] > 0.2

That should return True or False;  when dropped on Filters, select "True" as the filter condition.  Only rows that meet the test will display.

But again, it all depends on exactly what you're doing with the calculations.

1 of 1 people found this helpful
• ###### 5. Re: Is it possible to use And/Or Filters?

Hi Mike,

It's little bit confusing. Can you please share the required output with sample screenshots and some mock data for the same.