1 2 Previous Next 19 Replies Latest reply on Jun 21, 2018 2:04 PM by Renee Coker

# Understanding a Calculation

I don't understand table calculations very well, so hopefully someone will help me understand.

The calculation for % of Total Calc is [High Risk]/[Total Adult Population]

I don't understand how it came up with the percentages.

• ###### 1. Re: Understanding a Calculation

For the highlighted record, it's computed as:

(87,223 - 246,623)

--------------------    = -64.43%

246,623

You can drag the table calculated field into the measures, and edit it to view the formula used.

And you can modify it as required.

• ###### 2. Re: Understanding a Calculation

Do you want the value for Q1-Medicaid to be 18999/246623 ?

You don't want a table calc there.

You just want a calc that does SUM([High Risk)/SUM(Total Adult Population)

And that's not a table calc.

The quick table calc you show in your screen shot is giving you a percent change between Q1 and Q2.  (And between Q2 and Q3.  Etc.)

• ###### 3. Re: Understanding a Calculation

Renee,

As Hari said, you can drag over the quick calculation;

I think it is probably taking the difference in percents and dividing it by the second percent.

I think you may be looking more for just the straight difference:

[% of Total Calc] - LOOKUP ( [% of Total Calc], -1 )

with a Compute Using of Table Across.

• ###### 4. Re: Understanding a Calculation

My concern is that it is giving me a percent change on the total population from quarter to quarter instead of giving me a percent change in the high risk in relation to the total population from quarter to quarter. Any ideas on how to do this?

• ###### 5. Re: Understanding a Calculation

I could not open your workbook. Not sure why. Unless it is a firewall issue.

• ###### 6. Re: Understanding a Calculation

Actually, it's an issue with using different versions. Mine is 10.2.10 64-bit.

• ###### 7. Re: Understanding a Calculation

Renee,

Apologies, here it is in 10.2

• ###### 8. Re: Understanding a Calculation

Hi Renee,

For a better "Table Calculations" understanding, I also recommend to review the video tutorial from Tableau Learning* (*registration required) and a comprehensive article about Table Calculations below.

I hope this helps

Regards

• ###### 9. Re: Understanding a Calculation

Given the numbers in your screen shot, what are the numbers you want to see in the arithmetic for the first %change value?  (You are using your business terms, which are second nature for you, but not for me.  Tell me the specific numbers you want to be compared and included in the calculation for the first value, and where you want that first value to be.)

• ###### 10. Re: Understanding a Calculation

I'm not sure, but as an analogy, Total Population would be equivalent to a car dealership's total truck sales, and high risk would be equivalent to the sale of all trucks each quarter. The objective would be to know quarter by quarter the percentage of sales of 4wd trucks went up or down in relation to the total truck sales for that quarter.  Does that help?

I think it would be taking the percentage difference between total truck sales and 4wd trucks for one quarter, then comparing it to the difference in the next quarter to determine if sales went up or down? Does that sound right?

• ###### 11. Re: Understanding a Calculation

I'm not looking for concepts.  Tell me the physical numbers you want moved around.  In your screen shot you have numbers.  That's what I need you to use.

"I want 246,623 divided by 87,223, and 18,999 divided by 7,127, and I want the first of those two values divided by the second of those two values...  And if we do it right, the result should be negative 41 percent..."

Something like that.  You know your numbers.  You know what you need as an output.  What I can help you with is the proper syntax, and whether that needs to be a table calc or an aggregate calc.

I wish I had your workbook.  I'd be able to know what is in the [% of Total Calc] for starters.

• ###### 12. Re: Understanding a Calculation

I would like 246,623 divided by 87,223 for Q1, then 18,999 divided by 7,127 for Q2, then determine the difference between those resulting values to determine if the percentage of the high risk went up or went down. Then do the same from Q2 to Q3, Q3 to Q4, then Q4 to Q1 of the following year, etc.

I can only email my workbook. Our firewall prevents me from uploading due to possible PHI violations. Although there is no PHI in this workbook, I still cannot upload, only email.

• ###### 13. Re: Understanding a Calculation

See if this helps.

• ###### 14. Re: Understanding a Calculation

OK, so the [% Total Calc] should look like this: