5 Replies Latest reply on May 6, 2016 10:36 PM by Ashish Chaudhari

# Problems calculating 'with-in group' rates for a dimention with two groups.

I have a sample data set that has four columns ( id, graduated (Y/N), gender(M/F), cohort(2005-09) and I am trying to create a line graph that showes two lines with a % graduated (one for male and one for female) for every cohort. Here's my current attempt (also in the workbook attached)

1. I put the cohort pill on the column shelf I put the countd(ID) on the rows shelve and did a quick table calc (Percent of Total, Compute Using Table (down))
2. and I placed the status dimension on the Color mark, and finally I placed gender on the Detail mark.

What I get after doing this is four lines with a graduated status Y and N for each gender (Male and Female). The numbers are correct but I only want to display the graduated status Y line, one for male and one for female and hide the graduated status N line without affecting the percentage calculation. Any help or suggestions would be highly appreciated.

Thanks,

Dawit

• ###### 1. Re: Problems calculating 'with-in group' rates for a dimention with two groups.

Hi Dawit,

Fortunately it's very easy to get rid of the No lines.  Right click on the N in the legend select Hide from the menu and they are gone.

However to me your numbers look incorrect although I might be misunderstanding your requirement.  For example you have 4 females in the 2009 cohort two of which graduated so I would expect a 50% rate and your graph shows 20% graduation for females.  Tableau is coming up with the number by taking your 2 female grads and dividing by the 10 total students in the 2009 cohort.  Changing the percentages is also pretty easy if you want to do that.

Good luck,

Ivan

2 of 2 people found this helpful
• ###### 2. Re: Problems calculating 'with-in group' rates for a dimention with two groups.

Hi Dawit,

Please find my solution as well.

Crosstab result

Result

Please find the calculations in the workbook. Thanks for posting this one.

Thanks and Regards,

Ashish Chaudhari

2 of 2 people found this helpful
• ###### 3. Re: Problems calculating 'with-in group' rates for a dimention with two groups.

Thanks Ivan. The Hide menu is pretty helpful. I agree with the number problems as well. I made a mistake when I was building the workbook with a dummy data.

• ###### 4. Re: Problems calculating 'with-in group' rates for a dimention with two groups.

Thanks Ashish! I like how you calculated the rates. Very useful.

• ###### 5. Re: Problems calculating 'with-in group' rates for a dimention with two groups.

Hi Dawit,

Thanks for appreciating. I hope that have really helped.

I took 20mins more than Ivan. Truly credit goes to Ivan, the speed at which he replied to your query.

Thanks for giving me an opportunity to learn something different.

Regards,

Ashish Chaudhari