How to we make a filter from a calculated field a context filter in Tableau

0 votes
Booking Size is a computed field with the formula:

'Small' is defined as RANK PERCENTILE(SUM(BK Total)) >= 0 AND RANK PERCENTILE(SUM(BK Total)).5.

ELSEIF RANK PERCENTILE(SUM([BK Total]) >=.5 AND RANK PERCENTILE(SUM([BK Total]) >=.5 AND RANK PERCENTILE(SUM([BK Total]) >=.5 AND RANK PERCENTILE(SUM([BK Total]) >=.5 AND RANK PER THEN 'Medium Small' (.7)

ELSEIF RANK PERCENTILE(SUM([BK Total]) >=.7 AND RANK PERCENTILE(SUM([BK Total])) AND RANK PERCENTILE(SUM([BK Total])) AND RANK PERCENTILE(SUM([BK Total])) AND RANK PERCENTILE(SUM([BK To .9 AFTER THAT, 'Medium'

ELSEIF RANK PERCENTILE(SUM([BK Total]) >=.9 AND RANK PERCENTILE(SUM([BK Total)).95 THEN 'Medium Large' is selected.

END IF 'Large' ELSE

I'd want to make this a context filter since the RANK PERCENTILE function in the preceding filter (Booking Size filter) recomputes the already filtered table if I apply any other filter on top of it.
Mar 10, 2022 in Tableau by Neha
• 9,020 points
905 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Table calculation filters cannot be turned into context filters.

Context filters are examined at the data source very early in the operation pipeline (aka database server). Tableau does table computations late in the operation pipeline (aka client).

So you're wondering why something that happens late on one machine can't be set to happen early on another computer by definition. The reason for this is because Tableau's table calculation functions, such as rank percentile, are based on the aggregate query results supplied by the database or data source.

If you wish to push that functionality early in the pipeline, you'll have to rely on functions from the original data source. If your database supports features like rank percentile, you may include them into the underlying query using custom sql, SQL calls, or by creating a database view.

BTW, your computed field repeats comparison tests unnecessarily.

If you define a computed field named rk as RANK PERCENTILE(SUM(BK Total)), it will be RANK PERCENTILE(SUM(BK Total)).

Then, because each test may presume the previous tests failed, your field can be created more efficiently as seen below.

if rk < .5 then
  'Small'
elseif rk < .7 then 
  'Medium Small'
elseif rk < .9 then
  'Medium'
elseif rk < .95 then
  'Medium Large'
else
  'Large'
end
answered Mar 28, 2022 by Vaani
• 7,070 points

edited Mar 5

Related Questions In Tableau

0 votes
1 answer

How to add parameter and calculated field filter in tableau?

Hi Sindhu,  You cannot add parameter as a ...READ MORE

answered Mar 8, 2019 in Tableau by Cherukuri
• 33,050 points
5,270 views
0 votes
1 answer

How to create a single calculated field from multiple column filtering?

Try with this calculated field: ( ...READ MORE

answered Jul 6, 2018 in Tableau by ffdfd
• 5,550 points
1,315 views
0 votes
1 answer

How to perform a calculation using one variable with an aggregation in calculated field?

Hi, You can use the calculative field and ...READ MORE

answered May 20, 2019 in Tableau by anonymous
• 33,050 points
803 views
0 votes
1 answer

How to fix spelling error in a field or column value using Tableau?

You should be able to use a ...READ MORE

answered Mar 10, 2022 in Tableau by Neha
• 9,020 points
867 views
0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
10,228 views
0 votes
0 answers

Using Python and Tableau in conjunction with one another

Is it possible to mix Python visualisations ...READ MORE

Feb 28, 2022 in Tableau by Vaani
• 7,070 points
608 views
0 votes
0 answers

Tableau Desktop Inside Tableau Server

Is there an executable for Tableau Desktop ...READ MORE

Feb 28, 2022 in Tableau by Vaani
• 7,070 points
527 views
0 votes
0 answers

Tableau Map view Continent List

I've been attempting to tidy up my ...READ MORE

Feb 28, 2022 in Tableau by Vaani
• 7,070 points
666 views
0 votes
0 answers

Downloading tableau workbook from tableau server with data

I'm brand new to tableau server. I ...READ MORE

Feb 28, 2022 in Tableau by Vaani
• 7,070 points
674 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP