8 Replies Latest reply on Dec 17, 2019 12:42 AM by Donna Coles

# calculating percentages on subtotals

Hi,

I have four columns- category,sub-category,id and date.

category has four countries, sub-category has success, fail,marking,pending ,distinct id's in id columns and date column.

I would be needing a text table displaying

hours,country wise success percentage over other three sub-categories in the COUNTRY LEVEL.

 country-1 country-2 country-3 country-4 hours fail success fail success fail success fail success 1 2% 98% 2% 98% 2% 98% 2% 98% 2 2% 98% 2% 98% 2% 98% 2% 98% 3 2% 98% 2% 98% 2% 98% 2% 98% 4 2% 98% 2% 98% 2% 98% 2% 98%

Thanks

• ###### 1. Re: calculating percentages on subtotals

Hi, Also- Sucess is count of 'success' in sub-category column and fail id count of remaining three like'fail,marking and pending'

Thanks

• ###### 2. Re: calculating percentages on subtotals

Hi there

In order for us to help you, it would be very much appreciated if you could provide a packaged workbook with the sample data as described above, or at the very least provide the sample data in excel or similar in the structure you will be working with.  This saves us time in reconstructing the data and also ensures we don't make assumptions and provide a solution that then doesn't work for you.

If you're unsure how to do this, please refer to the recommended reading section in the 'Getting Started' area of the forums Getting Started in the Forums

Many thanks

Donna

2 of 2 people found this helpful
• ###### 3. Re: calculating percentages on subtotals

Hello Donna,

Thanks for the help, I have the excel but I dont know how to attach here..could you please help

Thanks

• ###### 5. Re: calculating percentages on subtotals

sample data

• ###### 6. Re: calculating percentages on subtotals

Hi

The sample data provided does not contain all the information as per your initial post, but based on what you've provided you want to do the following :

- create a calculated field to group your success & failures :

- add [Country] & [Success | Fail] to columns, [Number of Records] to Text and change [Number of Records] to to use a 'quick table calculation' of Percent of Total

-edit the table calculation to compute using Success|Fail

Regards

Donna

2 of 2 people found this helpful
• ###### 7. Re: calculating percentages on subtotals

Thanks..I got the output..however, just wanted to know for future reference..will it be possible to hide only fail in all the regions and should display only success(i tried but it is showing all 100% as the only count taking for success )

Thanks

• ###### 8. Re: calculating percentages on subtotals

You're probably ending up with 100% because you're 'filtering' by the Success | Fail field, which removes all the fail data from any of the calcs.  However Tableau has a 'sneaky' function that allows you just to 'hide' information in the view.  Right-click on the data you want to hide and select 'Hide' from the menu.