6 Replies Latest reply on Jan 17, 2017 12:03 PM by Tom W

# Recalculating score based on filter selection

Hello.  The survey data I have would list the question number, its response and maximum values.

If someone rates the question as Pass, then it gets the Maximum value.  If Fail, then it is 0.

For ID 100, the survey score is 63.64%

What I want to achieve in Tableau is for the user to select (from a Question filter?) the Question and recalculate the score.

On Row 26 (below screenshot), if the user selected Q6 and Q10, then the potential score could have been 90.91%.

This is to say if Q6 and Q10 was a Pass, then the score could have been 90.91% instead of 63.64%.

How do I do this selection and recalculation in Tableau?

Attaching excel file, tableau workbook. I am using Version 9.0

Thank you.

Oscar

• ###### 1. Re: Recalculating score based on filter selection

How is the sum of Q6 + Q10 20? It looks like they are both zero to me.

• ###### 2. Re: Recalculating score based on filter selection

The original is a zero.

What if scenario....

If Q6 and Q10 were a Pass, then the sum of Q1 to Q10 for ID 100 will be 20.

• ###### 3. Re: Recalculating score based on filter selection

Part of the challenge of doing this in Tableau is that parameters are only single choice. You cannot create a parameter which would allow you to select multiple 'questions' to forecast as a pass.

You could however have multiple parameters, one per question perhaps.

Let's say you create a parameter called 'paramQ6' as a boolean.

Then you would create a calculated field called forecastScore as:

IF [Question] = 'Q6' and [paramQ6] = true THEN [Maximum] else [Response] end

Then you can sum this new forecast score.

• ###### 4. Re: Recalculating score based on filter selection

You could also create a single string parameter which users type comma separated question numbers into. I.e. Q6,Q10.

Any question they type in here will be forecasted as true.

Create the string parameter i.e. Parameter1

Create a new calculated field -

SUM(

IF CONTAINS([Parameter 1],trim([Question]))

THEN

[Maximum]

ELSE

[Response]

END

)

/SUM([Maximum])

• ###### 5. Re: Recalculating score based on filter selection

The String Parameter and Calc Field method works.  Thanks Tom.

Any other suggestions from others?

• ###### 6. Re: Recalculating score based on filter selection

No problem. I'm not sure you'll get more suggestions unless you're a bit more specific about what you'd like to do differently versus the solve I provided above.