In tableau, I want to create a calculated field which is based on a filter and outputs an answer also based on a filter

Rica

I created a calculated field based on a parameter with [param1, param2, param3], and I want it to output the number of entries based on another filter [fil1, fil2, fil3].

Should look like something like this...I'm not sure if tableau can do it and if it can, how?

IF [parameter] = 'param1'
THEN [#Entries] WHERE [filter] = 'fil1', 'fil2', and 'fil3' //total entries
ELSEIF [parameter] = 'param2'
THEN [#Entries] WHERE [filter] = 'fil2' //entries based on fil2
ELSEif [parameter] = 'param3'
THEN [#Entries] WHERE [filter] = 'fil3' //entries based on fil3

Obviously that doesn't work, but should work like that????

EDIT: It's actually COVID19 data.

My parameters: Total Cases, Recoveries, and Deaths.

My filter is based on Health Status: Active, Recovered, and Died.

Based on a button, I want to choose 'Total Cases' and my graph of # of cases vs date will show all active, recovered, dead cases. If I choose 'Recoveries', the graph will only show recovered, and if I choose 'Deaths'. it will show deaths data.

AnilGoyal

Given your situation I feel that you need to create only one parameter and one related calculated field.

Create parameter1 for taking inputs say 1, 2, and 3.

create calculated field like this

CASE [parameter1]
WHEN 1 then SUM([field1 related with value 1 in parameter])
when 2 then SUM([field2 related with value 2 in parameter])
when 3 then SUM([field3 related with value 3 in parameter])
END

Just add this calculated field in view and control your results from 'show parameter option.

I have done it sample world indicators data in tableau.. Still if you are having problems, do tell me.

result

Screenshot of parameter created for your help.

parameter

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Calculated Field based on an Relation Aggregate with Filter Conditions in Tableau

In Tableau how can I create a calculated field that categorizes data based on data across rows?

Create calculated field based on other calculated fields

Tableau - I want to filter my data based on one dimension, but is being controlled using 2 parameters

How to create angularjs filter which outputs HTML

I want to toggle the table rows filter based on the text from buttons

Tableau Desktop - Create customized filter based on multiple values

Filter a row based on field=variable

filter based on a field value in awk

How can I filter an Flutter List based on a field with an array value?

create dictionary based on filter in sqlalchemy

Create filter based on cell value

How do I create a date range filter in a class based view?

Filter - Calculated fields relation in Tableau

Power BI Calculated Column based on max date and a filter

Filter based on column which is not in summarize "DAX"

Date filter reference in a calculated field

Filter JSON Objects based on field using LINQ

Filter a pandas dataframe based on a derived field

Mongoose populate first and then filter based on populated field

Filter an array of objects based on field name

Filter array of objects based on a field in each object

How to filter objects at django based on related field?

Filter list based on more than one field

Get/filter documents based on field id

Filter Array of Objects based on input field in React

Selecting field from array based on a value filter

Filter elasticsearch bucket aggregation based on term field

Django filter based on ForeignKey model field