6 Replies Latest reply on Aug 6, 2016 7:07 PM by Mahfooj Khan

# Filtering by a set (dynamicly by using a parameter)

Hello Community

My Problem: I use a set to filter several items according to, lets say, market share of xy. Further, I created a parameter that lets the user choose a certain minimum percentage of market share for this set to contain.
However, the filter does not work correctly. When I set the parameter to 40%, items that have 42% market share do not appear on my view. They only appear until the 40% level. (this happens as well for other combinations like 85 and 87

Does anyone have a solution for that problem? For details, see below:

Set is caculated: Market share XY > Parameter A

Parameter A: is a float going from 0 to 1 using 0,01 steps

Market share XY is a calculated field: sum(products by XY)/sum(total products)

Thank you very much for your support

Peter

• ###### 1. Re: Filtering by a set (dynamicly by using a parameter)

Hello Peter - Please post your problem with a Sample set of data. You don't have to share your actual data, but you can create a small similar data set.

Thanks,

Manideep

• ###### 2. Re: Filtering by a set (dynamicly by using a parameter)

Hello Peter - Please post your problem with a Sample set of data. You don't have to share your actual data, but you can create a small similar data set.

Thanks,

Manideep

• ###### 3. Re: Filtering by a set (dynamicly by using a parameter)
Year
CompanyProduct# sold by person a# sold by person btotal # soldcalculated field: Share person aKopfzeile 9Kopfzeile 10Kopfzeile 11
1Ax1024340,29
1Ay413

17

0,24
1Bz3140,75
2Ax55100,5
2Ay313160,19
2Au74110,64
2Bz312150,2
2Cw815230,35

I want Tableau to dynamicly filter my view.

It may only show those companies where person A has a share > x% in year 1.
I use a parameter "parameter A"  to choose the percentage level. Depending on my chosen percentage level Tableau may only show company A or both company.
And the a set that uses the formula: share person a > parameter a
Alternatively I have tried this formula: If share person a > parameter a then 1 else 0 = 1

Both don´t work. And recognized something else, that is strange:
When I ask Tableau to show me the data for lets say company A it shows the correct aggregated share of person a for year 1. However, in the more detailed underlying data view only a part of my relevant rows are shown (e.g, in my example row 1 is shown as underlying, row 2 is not shown)

Thank you in advance.

Peter

• ###### 4. Re: Filtering by a set (dynamicly by using a parameter)

Is that what you wanted?

Workbook (public version 9.3) has been published in my profile. Have a look and let me know If you've any question. Follow the link to download the workbook.

Mahfooj

• ###### 5. Re: Filtering by a set (dynamicly by using a parameter)

Thank you for your answer!

I´m afraid that we are not at the solution yet. Thank you though and I think we are on the right track.

I would need the solution to aggregate each companies total sold and then calculate the % share on company level.
Actually, I thought that tableau does that because I used the formula % share=sum(sold by person A)/sum(total sold) and I was viewing data on a company level.

So it should check for company A in year 1: is 14/41 > 40% and if yes view the data.

Peter

• ###### 6. Re: Filtering by a set (dynamicly by using a parameter)

You can see Company A is not featuring in the result set. Because in Year 1 Company A share contribution was 27.45%.

So It has been filter out from the view as per your requirement. Only company B was able to made share contribution more than 40%.

Let me know If you've any query.

Mahfooj