5 Replies Latest reply on Dec 15, 2014 12:59 PM by Trudy Walter

# How do I calculate top box performance from a survey?

This is probably a very easy calculation, but I can't get it to work.  I've got a website survey that asks how successful a person's visit was.  They are responding on a 5-point scale. I am looking to calculate the number of people that responded with a 5 and divide that by total responses (1-5).  This would show the success rate.

I created a calculated metric that reads:

COUNT([how_successful]=5)/COUNT([how_successful])

It says the calculation is valid, but the results are not showing the right percentages. I assume I wrote the formula wrong.

Any help would be appreciated.  I should also include the obligatory, I'm new to Tableau...

THANKS!

• ###### 1. Re: How do I calculate top box performance from a survey?

Steve,

Can you provide a .twbx copy of your workbook?

Thanks,

Associate Consultant

Mariner, LLC

http://breaking-bi.blogspot.com

• ###### 2. Re: How do I calculate top box performance from a survey?

Of course.  I need to give you dummy data, as I'm working directly with client data. But please see attached.  The success rate should be any person that selected 5.

• ###### 3. Re: How do I calculate top box performance from a survey?

Steve,

This seems to solve your issue.  I have attached the workbook as well where I created the calculation.  If you are not including how_successful as a field in the view, then the TOTAL() function is unnecessary (and possibly detrimental).

Thanks,

Associate Consultant

Mariner, LLC

http://breaking-bi.blogspot.com

• ###### 4. Re: How do I calculate top box performance from a survey?

Exactly what I was looking for. Thank you, Brad!

Steve

• ###### 5. Re: How do I calculate top box performance from a survey?

How would you do this table calc if you want just those who said 5 (Top 1 box), those who said 4 or 5 (Top 2 box), 3, 4, 5 (Top 3 Box), and 1, 2 (Bottom 2 Box)? Do they each have to be a separate calculation or is there a way to combine it into one calc?  I was trying to set it up like this and then was going to create a parameter to use as a filter for Top 1 box, Top 2 box, etc) :

COUNT(IF [Value]= 5 THEN 1 END) / TOTAL(COUNTD([Response ID (Merged)]))

COUNT(IF [Value]= 5 OR IF [Value]= 4 THEN 2 END) / TOTAL(COUNTD([Response ID (Merged)]))

COUNT(IF [Value]= 5 OR IF [Value]= 4 THEN 3 END) / TOTAL(COUNTD([Response ID (Merged)]))

I am also a newbie to Tableau.

Thanks,

Trudy