10 Replies Latest reply on May 12, 2015 12:27 AM by kettan

# Educational Brain Teaser: Percent of Totals

Challenge

In Tableau 9.0 using Superstore data, and without using Table Calculations set up the viz below and write the mystery calculation. It uses a parameter to toggle between the percent of total for all states, and the percent of total for only the three states showing.

Percent Showing:

Percent All:

Rating

Please also rate this challenge's difficulty level:

1.  Very easy

2.  Easy

3.  Neither easy nor difficult

4.  Difficult

5.  Very difficult

Enjoy!

--Shawn

• ###### 1. Re: Educational Brain Teaser: Percent of Totals

Nice! I give it a 2 for one solution, and a 3 for another.

1 of 1 people found this helpful
• ###### 2. Re: Educational Brain Teaser: Percent of Totals

Glad you liked it. Jonathan, I give you a 5 for finding this post mixed in with all the Korean posts!

--Shawn

• ###### 3. Re: Educational Brain Teaser: Percent of Totals

Bump. (Now that the attack is over.)

--Shawn

• ###### 4. Re: Educational Brain Teaser: Percent of Totals

I like it too!  I give it a 2.  It took me a minute to think of Jonathan's "other solution" -- I'll agree with a 3 on that one.

1 of 1 people found this helpful
• ###### 5. Re: Educational Brain Teaser: Percent of Totals

Good one shawn,

I was trying on that I wrote mustic calculation as

I have used SUM(SALES)/TOTAL(SUM(SALES)

Calcu 1

if [Select Percent Total]="Percent of All" then 'true' elseif [State]="Percent of Showing" then

'true'

else  'false'

end

I didnt get the else part

like if I select 3 state then....

1 of 1 people found this helpful
• ###### 6. Re: Educational Brain Teaser: Percent of Totals

Venkatesh, thanks for playing along! But you missed a key bit of the challenge:

Challenge

In Tableau 9.0 using Superstore data, and without using Table Calculations set up the viz below and write the mystery calculation.

TOTAL() is in fact a Table Calculation, so it's off limits for this challenge. The point of this challenge is to get us all thinking of ways to use LOD expressions (hint!) to replace Table Calculations.

Note on Ratings & Zens: Just like the rest of us Zens tend to rate things they already know as easy (2). But please remember, the Zens have been playing with LOD expressions since the 9.0 Alpha days. So add a point (or maybe a point and a half) to their rating of a brain teaser.

Please don't feel 'unworthy' just because the answer didn't come to you immediately.

Cheers,

--Shawn

• ###### 7. Re: Educational Brain Teaser: Percent of Totals

Here you go. The answer is posted here: Tinkering With LOD Expressions & Percent of Total « Tableau Tinkering

And the workbook is attached to this post.

Cheers,

--Shawn

SHOUTOUT to Bora Beran. Great explanation and chart of filter order! Thx.

• ###### 8. Re: Educational Brain Teaser: Percent of Totals

I marked at least 50 of them as spam last night. There should be a better way of getting rid of these. If somebody just created an account and started posting at a rate of  1 message/min with almost the same exact content, they should probably be blocked automatically. If not, then if everything they posted is marked as spam, then maybe they should be blocked at least to make life easier for people trying to keep the forums clean. Patrick Van Der Hyde  ?

1 of 1 people found this helpful
• ###### 9. Re: Educational Brain Teaser: Percent of Totals

For me this was trickier as I had not used one aspect of LODs yet, as mentioned in the solution. I got everything else working correctly, so the last bit was trickier for me.  I'm relatively new to Tableau, but I would give this a 3.5 -4.  I would also like to say I hope to keep seeing more of these, as they are fun and incredibly useful.

• ###### 10. Re: Educational Brain Teaser: Percent of Totals

Thanks Bora Beran. Great visual explanation indeed!

The simplicity, conciseness, and right-to-the-point makes this image my favorite LoD explanation:

1 of 1 people found this helpful