12 Replies Latest reply on Jan 29, 2019 2:13 AM by Prakash Sethy

percentage calculation question

Hello ,

" What is the percent of total Sales for the ‘Home Office’ Customer Segment in July of 2012? "

this is the question for super store data..

the answer for this query is given as 23.97% but I get it as 5.3456% something like that..  why is that so? can someone answer me pls...

I did like this

1) sum(sales) in the column

2) month(order date) in the row

3) in the filter shelf , I put segment and selected "Home Office"

4) in the Table calculations " percent of total"

• 1. Re: percentage calculation question

Hi Kaylan,

You need to adjust the scope of your percentage of total calculation from Table (Down).

Steve

• 2. Re: percentage calculation question

Hello ,

thanks Steve,

regards,

kalyan

On Fri, Jan 29, 2016 at 7:06 PM, Steve Martin <tableaucommunity@tableau.com>

• 3. Re: percentage calculation question

The solution did not work for me. Please find attached the excel datastore and when the above steps are applied I get 7% for July 2012

THanks

Jag

• 4. Re: percentage calculation question

The solution did not work for me. Please find attached the workbook.

Thanks

Jag

• 5. Re: percentage calculation question

I think the problem is with the data provided ... otherwise that should work fine.

and you're right Jagjit... I tried it and getting 7.x % for the month of July 2012

• 6. Re: percentage calculation question

This does work, as this is related to the Tableau training, I was deliberately coy in my answer insofar as to provide you with guidance without providing the full answer.

The calc is the percentage of total scoped to Customer Segment so either:

Convert the Sum(Sales) to a percentage of total table calc and then scope to Customer Segment or create the full calc: Sum(Sales) / Total(Sum(Sales))

and then scope to Customer Segment

Steve

• 7. Re: percentage calculation question

Hello Jag,

You can get to the result you desire if you get the addressing and partitioning for your quick table calc right. Bear in mind that for table calcs their orientation is separate from the underlying formula itself. In the attached workbook I am getting to the desired result, when I take the month of July 2012 as my total, and calculate the percentage of each customer segment out of that. Have a look, and revert with comments if any further help is needed!

BTW some of the best starter learning resources regarding table calcs are:

1) This whitepaper from Tableau and

2) This exercise workbook from Tom Brown

Take care,

Vlad

1 of 1 people found this helpful
• 8. Re: percentage calculation question

Great responses.  I have a huge issue in that my Superstore doesn't dhow any sales for for Home Office in July 2012.

This is weird.

***********Edit*********

I redownloaded another from Tableau Community and get 4.65%

Is there some "Official" Download location for the Superstore?

*************Edit again************

From a Global Superstore DL, in the raw excel, I got 5.65%

What are these sample questions based on?  Or has the sample test become obsolete with wrong answers?

**************EDIT FINAL*************

OK I get it.  I see what Vladislav did and my mistake.

Pull in just the Orders table and go with it.  I was pulling in all the tables and inner joining them which was throwing everything off.

Thanks V, It was a good thinking exercise overall.

• 9. Re: percentage calculation question

>

Hey Steve, i did what you said, but i am getting 17.02

I have tried every which way and i cant get the answer to come out to the 23.97.
I am a new user of course, but i would appreciate your insight.

Thanks

• 10. Re: percentage calculation question

The answer is 23.97

Here is the solution -

Let me share how I solved it.

Bring Customer Segment to Columns and Sales to Rows. Compute Sales using Table (across).

Put Filters for Order Date - 2012 and July.

You should get the result as expected.

The dataset that I used is from http://mkt.tableau.com/files/DesktopQA_ExamGuide.pdf - just before Question 4, there is a link to the Sample Superstore File.

Hope that helped.

Please let me know if you still face any difficulty.

1 of 1 people found this helpful
• 11. Re: percentage calculation question

Filter out data for july 2012 and use customer segment for rows and sales for text with quick calculation of percent to total. The question was confusing to understand.

• 12. Re: percentage calculation question

Here is the simplest way using table calculation.