4 Replies Latest reply on Nov 28, 2016 12:14 PM by Matthew Risley

# Making A Better Calculation

Hey Tableau community!

I have a calculation that works, But I'd like to make it better.

The calculation is OSAT (Overall Satisfaction). There are multiple different questions in a survey that capture OSAT for different products. Each product's OSAT is a column in my data set. OSAT is based on values of 1-10.

The standard OSAT calculation is   %9's and %10's ÷  Total Responses

Here is how I calculate it so far:

- I add up the 9's and 10's

- Divide that by the count

I have many OSAT questions and making two calculated fields for each one seems tedious. However, I am prepared to do so.

Is there a way to do this within one step (ie. One calculated field) ?

Thanks!

• ###### 1. Re: Making A Better Calculation

Looking superficially i'd say you can group this OSAT's.

How about you post a piece of data with fake info?

• ###### 2. Re: Making A Better Calculation

Luciano,

The goal of the project is to keep the OSAT scores for different products separate.

And I know I'm committing a Forums sin for not uploading the data source, but I'm working from home today without the resources to dummy up the data.

Thanks,

--Matt

• ###### 3. Re: Making A Better Calculation

First of all, to answer your original question I think you can just copy the code from [Number of 9s and 10s] into the SUM() in [OSAT %].

With that said, as someone who works almost exclusively with survey data, I would strongly recommend that you restructure your data set to be at the response level (that is, one row per survey response) as opposed to being at the survey level (one row per respondent / survey). Instead of creating a new field for each survey item, you could simply create the following:

[OSAT %] : AVG(IF [Response] = 9 OR [Response] = 10 THEN 1 ELSE 0 END)

This would allow you to have use a single calculated field for all questions.

• ###### 4. Re: Making A Better Calculation

Stephen,

Couldn't agree more with the response level. A very wise thing and I hope the project moves in that direction.

PS: ..... I knew the calculation was something so simple. Thank you!