4 Replies Latest reply on Nov 24, 2014 12:40 AM by Prashant Sharma

# How to filter a viz based on a combination of multiple paramters and logic

I have a viz (text table/bar graph/etc) which I need to filter based on the following logic

(Salary > X) OR  ( Age > Y AND Salary > Z )

For this, I have created three parameters which will take in the values of X, Y & Z respectively.

After this I created a Calculated Field where I put in the above logic somewhat like this....

IF (Salary > X) OR  ( Age > Y AND Salary > Z ) then "Include" else "Exclude" End

But the problem I am facing is, I am unable to drag this Calculated field to my Filter Shelf and filter on "Include". And this is because my Calculated Field is getting categorized as a Measure.

How can I work around this ?

• ###### 1. Re: How to filter a viz based on a combination of multiple paramters and logic

Is Salary or Age field is pre-aggregated fields? If yes then instead of "Include" & "Exclude" use 1 & 0 & make it continuous & then use it as filter. If these fields are not pre-aggregated then problem is something different & for that you have to attach your sample workbook (.twbx) so that we can suggest you according to that.

Warm Regards,

Prashant Sharma - India | LinkedIn

• ###### 2. Re: How to filter a viz based on a combination of multiple paramters and logic

Hello Bodhisattva

can you please attach a sample workbook for this case

it will help us to understand this.

Thanks

Sonal Agrawal

• ###### 3. Re: How to filter a viz based on a combination of multiple paramters and logic

Hi Prashant and sonal  ... thank you for your suggestions...

I am unable to replicate my case into another workbook since there are quite a few calculated fields. But I will try to describe the situation as much as I can.

Problem Statement : Show rows in a text table that satisfy the logic : ( Age > a ) AND ( ( \$VALUE > b ) OR ( CHANGE% > c AND \$VALUE > d ) )

The above logic needs three fields from my dataset

1. AGE
2. \$VALUE
3. CHANGE%

Out of these three, CHANGE% is the only pre-aggregated (calculated) field.

Now, here are the methods I tried

• Without the CHANGE% field and without any aggregated functions - true or false : WORKS, but is INCOMPLETE

• Without the CHANGE% field and with ATTR - 1 or 0, and continuous : DOES NOT WORK

• With the CHANGE% field and with aggregated functions - 1 or 0, and continuous : DOES NOT WORK