4 Replies Latest reply on Nov 30, 2016 12:10 PM by Norbert Maijoor

# Simple Division Calculation is Stumping Me

Hi All,

I am having the hardest time figuring out how to create a very simple division calculation and I'm about to pull my hair out!

What I am trying to find is the percentage of inactive patients.

I first determine whether a patient was active or inactive:

Then I created Active and Inactive measures and then a measure of them combined: (there might be a better way of doing this)

Then on to what is apparently making me feel like a crazy person:

When I place this next to the numbers it shows up as NULL

I have tried not using SUM in the Active and Inactive calculations and then using SUM in the % calculation and it still shows up as NULL. Then I tried not using SUM at all for all calculations, still nothing.

I have no clue on how to figure this one out.

I've attached a workbook and any help would be greatly appreciated!

Regards,

Brittney

• ###### 1. Re: Simple Division Calculation is Stumping Me

Hi Brittney,

Find my approach as reference below and stored in attached workbook version 10.0

I found two ways with same result

Based on "Grouping"

count([inactive reason (group)])

1 of 1 people found this helpful
• ###### 2. Re: Simple Division Calculation is Stumping Me

Thank you, Norbert. This is very helpful and the correct answer to my question. I do have another question for you though. I have company names, which I hid in my attachment, how would I go about finding the percent of Inactive patients for each specific company? The way you have shown me only shows the percentage of inactive patients compared to the total amount of patients for all of the companies.

I appreciate all of your help!

Regards,

Brittney

• ###### 3. Re: Simple Division Calculation is Stumping Me

I figured out how to get the percentage of Active and Inactive patients for each company individually.

Instead of creating a group of Active and Inactive patients. I used what I created first, which was a calculated field to create the groups:

Then I used Norbert's advise and used the count function on the above dimension:

Once that was done I used a Table Calculation of Percent of Total, but instead of using the whole Table I just used "Table (across)" using "Active VS Inactive":

I'm still fairly new to Tableau so it was an adventure for me to figure this out.

Thank you again, Norbert!!

Regards,

Brittney

• ###### 4. Re: Simple Division Calculation is Stumping Me

Hi Brittney,

You are welcome. Thanks for the "awards" Much appreciated:)