4 Replies Latest reply on Aug 18, 2016 7:21 AM by Keshia Rose

# Filtering using a calcuated field

Hi everyone,

I have question that I am just not able to solve with my current tableau skill level. However, I would really like to learn about ways to solve my problem.

YearCategorySubcategoryFilter valueDisplayed value 1Displayed value 2
2011Ax

10

11
2011Ay12311
2011Bz1411
2011Cw311
2011Cw43611
2012Ax3411
2012Ay23411
2012Ay34611
2012Bz2311
2013Ax23411
2013Bz21311
2013Cw6411
2013Cq201

1

What am I already doing with this data?

I do show display values 1 and 2 over the year periods and also other similar values.

I now want to filter (using a parameter) my displayed values by column "filter value" for year 2013.
If I'd set the parameter to 100, I only want Category A and B to be shown on my chart (2011 only including display values for a,b and so on)

If I´d set the parameter to 214, I only want Category A to be shown in 2011,2012,2013.

Do you guys know a smart way to do that?

Thank you very much for the support!

Cheers!

• ###### 1. Re: Filtering using a calcuated field

can you make a calculated field like:

if <parameter>=100 and (category='A' or category='B') then [Category]

elseif <parameter>=214 and (category='A') then [Category]

.

.

.

end

I don't think you worded your problem very well so this probably isn't the solution you want

1 of 1 people found this helpful
• ###### 2. Re: Filtering using a calcuated field

Hi Peter,

How exactly is your filter supposed to work? keep values that are above the parameter? below the parameter? Are you comparing each individual number? the sum for the year? the some over all? the max ever? Let us know and we can probably come up with a solution.

Take care,

Keshia

• ###### 3. Re: Filtering using a calcuated field

Hi Keshia,

thank you for your response. I will try my best to explain my intention.

What I do:

I sum up the displayed values over the years. 2011: 10+123+14+3+436 and 2012...
If necessary I drill down and e.g. show the sum per categroy per year.

I am now only interested in data of categories that exceed a certain sum of "filter value" (e.g., 100) in year 2013.
To dynamically filter the data, I would like this sum to be defined by a parameter that one can set from 1 to 10000.
If I set the parameter to 100, this should filter out category C from my data. (across all years, even if the sum of filter value is higher than 100 in 2011 or 2012).
However, the sum for category A and B should be calculated for every year, if it exceeds 100 in 2013 (i.a. if the sum in 2011 would be 80, the data should still be displayed because only the sum of 2013 is the filtering criteria)

Hope this helps.

Thank you very much.

• ###### 4. Re: Filtering using a calcuated field

Hi Peter,

Ok, now I think I got it. First, you will need to create a calculation that only looks at values for 2013 (Selected Year Sum). I used a parameter so you could change the year you are comparing but you can just type in 2013 as well. Next you can create a calculation that asks if that sum is greater than the threshold parameter (Filter). I've attached a workbook that demonstrates this.

Let me know if this is what you are looking for.

Take care,

Keshia

1 of 1 people found this helpful