Posts by Luke Stanke

2019 Week 1: Sales Drill Down

We’re back for 2019. We’re using the hashtag #WorkoutWednesday2019. The challenge this week involves building a dynamic drill-down table. This one is slightly more difficult than average so be sure to check the spoilers at the very bottom if need be.

Challenge

 


 

Click to view on Tableau Public

Requirements

  • Dashboard size is 500px wide by 600px tall.
  • Create a table that shows sales for category and year. When you click on a category show the sales by sub-category below it.
  • Use the right arrow “►” and the down arrow “▼” to indicate when details are showing. This makes it look like an accordion.
  • Match row borders and row shading to highlight these values.

Dataset

This week uses the superstore dataset for Tableau 2018.3.  You can get it here at data.world

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday2019 and tag @AnnUJackson, @LukeStanke, @lorna_eden, @curtisharris_, and @VizWizBI!

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

Spoilers

  • Union the data to itself one time.
  • One part of the union will create the summary for category and the other will create the summary for sub-category.

Week 50: What is the makeup of sales?

This week is another challenge that comes straight from work. I actually had difficulty creating the chart I wanted. I really wanted to sort the states by the selected Sub-Category percentage but I ran out of time and had to hack together a solution for this week. Either way the more important challenge is in creating the appropriate pie chart.

Challenge

Click to view on Tableau Public

Requirements

  • Dashboard size is 800px wide by 800px tall.
  • Create a pie for each state
  • Use a parameter that describes each sub-category.
  • Highlight the sales of the selected sub-category. Also highlight the remaining sales for the remainder of sub-categories that are share the same category of the selected sub-category. The third category will be all other sub-categories.
  • Color by category. Use the Winter and Seattle Gray color palettes.
  • Jedi-level: no hard-coding category to sub-category.
  • Create the legend using a separate sheet.
  • Match tooltips.

Dataset

This week uses the superstore dataset for Tableau 2018.3.  You can get it here at data.world

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday2018 and tag @AnnUJackson, @LukeStanke, @lorna_eden,
@curtisharris_, @RodyZakovich, and @VizWizBI!

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

Week 48: Profitability Bridge

This week we’re building a chart I was asked to create at work. A stakeholder drew this exact chart type and said, “make the chart look exactly like this!” At first glance I wasn’t sure I would be able to do it. After a little playing around I was able to re-create it!

Challenge

Click to view on Tableau Public

Requirements

  • Dashboard size is 500px wide by 800px tall.
  • Create a waterfall chart showing the top 5 sub-categories by sales. Include an other category for all other categories.
  • Show a bar on the far-left of the waterfall that shows all sub-categories. Label it all.
  • Add dashed lines that “connect” each bar.
  • Add a dashed line that connects the All bar with the Other bar.
  • Make sure each line looks as a single continuous dashed line. Watch your padding and axis label width!
  • Label each sub-category above the bottom line of each bar.
  • Label each bar with the profit ratio below the bottom line of each bar.
  • Add a filter by region. Make sure the filter is centered on the dashboard above the chart.
  • Color the bar gray if it above zero (#ACBAC3) or pink if it is below zero (#E48070).
  • Match tooltips.

Dataset

This week uses the superstore dataset for Tableau 2018.3.  You can get it here at data.world

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday2018 and tag @AnnUJackson, @LukeStanke, @lorna_eden,
@curtisharris_, @RodyZakovich, and @VizWizBI!

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

Week 43: Where should we focus our sales effort? #TC18 Edition

Heads up: we are at Tableau Conference and we’ll be delayed on checking Twitter. Also Luke will attempt to live stream via Twitter.

Challenge

This week we take Workout Wednesday live at Tableau Conference.


Click to view on Tableau Public

Requirements

  • Create a map and color the overall top, top 5, bottom, bottom 5 states by sales.
  • Label the top 5 and bottom 5 states.
  • Add a filter for segment.
  • Show the city with the top sales for every state.
  • Place a star on the top 5 cities. Place an x on the bottom 5 cities. Place a circle on all other cities.
  • Size the star to be the largest, then the x, then the circle.
  • Match map formatting.
  • Match tooltips.

Dataset

This week uses the superstore dataset for Tableau 2018.1.  You can get it here at data.world

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday and tag @AnnUJackson, @LukeStanke, and @RodyZakovich.  (Tag @VizWizBI too – he would REALLY love to see your work!)

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

Week 40: Where are Sub-Category Sales Down?

Challenge

This week you are building something that looks like a text table. But there are a few twists, including the fact you cannot use text as a mark type.

click to view on Tableau Public

 

Requirements

  • Use the shape mark type.
  • Do not create a custom mark type that is transparent.
  • Round sales to the nearest dollar. Make sure the values are right-aligned.
  • Make sure to add banding that alternates from sub-category to sub-category.
  • Place a red arrow down (▼) to the right of sub-category sales that are down compared to the year previous.
  • Place a red arrow down (▼) in front of a sub-category label in the table if sales were lower in 2018 compared to sales in 2015.
  • Show only order dates for 2016, 2017, and 2018 in the table.
  • Colors are Dark gray (#414141), medium gray (#6B6B6B), and red (#F36754)
  • Be able to slice the data by Region.
  • Match tooltips
  • BONUS: embed a visual in the tooltip that shows yearly sales on a continuous axis and has a “▼” on the years where sales were down compared to the year previous.

 

Dataset

This week uses the superstore dataset for Tableau 2018.1.  You can get it here at data.world

 

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday and tag @AnnUJackson, @LukeStanke, and @RodyZakovich.  (Tag @VizWizBI too – he would REALLY love to see your work!)

 

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

 

Solution: Paying The President

We’re working on providing different solutions for the rest of the year. While it’s not a guarantee that we’ll have one every week, we want to dispel any myths around the difficulty of the problems.

Last week Curtis made a video on how he created the solution. He’s going to do this every week. Curtis didn’t get it perfect but that’s okay it’s really close!

I’m not going to show you how to do every part, but I will show you a few tips that will get you going!

First let’s review the modified brief that I’ll use for this demo:

  • Dashboard size: 900px x 620px.
  • Background color: #F9F8F7
  • The data has unknown dates. Make all unknown values show up 3 months past the maximum date. If you need help see SPOILERS #1 below for the formula.
  • Create the stacked rectangle plot at the Source level. Use Size to size the boxes. Place a space of 0.01 between each of the squares. Make sure the order of the boxes matches, too. *This is the key challenge this week*
  • Create an “axis” that labels the start of each year as black and abbreviated month labels of April, July, and September, respectively. Also label the unknown values with “Unknown”. See SPOILERS #2: for help with the “axis”. And see SPOILERS #3 for the month label.
  • Color by source_group: Donald J Trump For President: #F7C480, Other: #76B7B2, Taxpayers: #555555
  • Add annotations for when Trump announced candidacy, gets nomination, the election, and inauguration. You’ll want this: ▼
  • Add the annotation around incomplete/missing data.
  • Add the divider and bracket on the dashboard.
  • Match tooltips.
  • Credit the original authors/designers and link to the original:
    Originally by Derek Kravitz and Derek Willis, ProPublica, and Paul Cronan, Mark Schifferli and Charlie Smart, Fathom Information Designhttps://projects.propublica.org/paying-the-president/.

So were talking about just 3 points. And I give you help with two of them!

Step 1: Unknown Dates

First you need to figure out the unknown dates.

IFNULL([Date], DATEADD("month", 3, {MAX([Date])}))

Put this on Columns and make it date value at the month level.

You’ll end up with this:

Step 2: Create mark logic + add level of detail.

Next were going to figure out the spacing for the marks. The formula utilizes the height of each square and then adds .01. After that we subtract half the hight of the square to center the mark where it should be. The final formula looks like this.

RUNNING_SUM(SQRT([Size]) + .01) - SQRT([Size])

Set your mark type to square and it produces this visual:

The sizing calculation before the appropriate marks are ordered on the marks card.

Next up: Let’s add the correct level of detail to the marks card. Add exact date, source to detail. Source (group) to color, and Size to size. That will give you an imperfect visual where you need to edit the table calculation (be sure to re-order the values).


Once you have edited this you end up with this visual:

It’s almost there!

It’s so close!

Step 3: Dual Axis of MIN(-3) and format.

So were basically there already. Now come’s the trick with the axis. I created a dual axis chart with the second value just an in-line calculation of MIN(-3). Synchronize this and remove all the values from this marks card.

After that you just need to create two calculations. One for the bold font and one for the gray font. Then place these on text on the marks card and format.

Years calculation (also in spoilers):

IF MONTH([Date]) = 1
OR DATETRUNC("month", [Date]) = {MIN(DATETRUNC("month", [Date]))}
THEN STR(YEAR([Date]))
ELSEIF DATETRUNC("month", [Date]) = {MIN(DATETRUNC("month", [Date]))}
THEN "Unknown"
ELSE "" END

Month Calculation: 

IF DATETRUNC("month", [Date]) != {MIN(DATETRUNC("month", [Date]))}
THEN IF MONTH([Date]) = 4
    THEN "APR"
    ELSEIF MONTH([Date]) = 7
    THEN "JUL"
    ELSEIF MONTH([Date]) = 10
    THEN "OCT"
    ELSE ""
    END
ELSE ""
END

Now we just add these to text on marks and format like this:

Year and Month labels.

Then we have this:

Note the faux axis labels.

Step 4: Format

Finally we need to revers our axis, hide our axes, and format. Then we end up with the final product looking like this:

Not bad.

Not bad for 4 steps!

Week 37: Recreating Paying the President

Challenge

This week we’ve partnered with Makeover Monday to examine potential conflict of interest between President Trump’s personal holdings and his campaign staff and government officials using data from Propublica. We’ll also be giving you a few formulas so you can focus on the important parts of the challenge: “stacking” the squares and placing the labels of year, month, and unknown on the “axis”.

click to view on Tableau Public

Setup

1. Create a calculated field called Size. Size will be used to size the squares. The size of the squares represents the overall area of the symbol. There are five different values each representing a different threshold of amount spent at a property.

IF SUM([Amount]) < 1000
THEN 1
ELSEIF SUM([Amount]) <10000
THEN 4
ELSEIF SUM([Amount]) < 100000
THEN 9
ELSEIF SUM([Amount]) < 1000000
THEN 16
ELSE 25
END

Requirements

  • Dashboard size: 900px x 620px.
  • Background color: #F9F8F7
  • The data has unknown dates. Make all unknown values show up 3 months past the maximum date. If you need help see SPOILERS #1 below for the formula.
  • Create the stacked rectangle plot at the Source level. Use Size to size the boxes. Place a space of 0.01 between each of the squares. Make sure the order of the boxes matches, too. *This is the key challenge this week*
  • Create an “axis” that labels the start of each year as black and abbreviated month labels of April, July, and September, respectively. Also label the unknown values with “Unknown”. See SPOILERS #2: for help with the “axis”. And see SPOILERS #3 for the month label.
  • Color by source_group: Donald J Trump For President: #F7C480, Other: #76B7B2, Taxpayers: #555555
  • Add annotations for when Trump announced candidacy, gets nomination, the election, and inauguration. You’ll want this: ▼
  • Add the annotation around incomplete/missing data.
  • Add the divider and bracket on the dashboard.
  • Match tooltips.
  • Credit the original authors/designers and link to the original:
    Originally by Derek Kravitz and Derek Willis, ProPublica, and Paul Cronan, Mark Schifferli and Charlie Smart, Fathom Information Design

    https://projects.propublica.org/paying-the-president/.

 

Dataset

This week uses a modified version of Spending at Trump Properties from Propublica (original data here – don’t use this one). You can get it here at data.world.

 

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday and tag @AnnUJackson, @LukeStanke, and @RodyZakovich.  (Tag @VizWizBI too – he would REALLY love to see your work!)

 

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

 
 

 
 

#SPOILERS

1. For those still learning here is the formula for the spacing the unknown values three months out from the last known month:

IFNULL([Date], DATEADD("month", 3, {MAX([Date])}))

 
2. For those still learning here is the formula on how to create the faux axis:

IF INDEX() = 1
THEN -3
END

Using this INDEX() function allows to only show a single mark and not have a bunch of overlapping marks per month.

3. For those still learning here is the formula for creating the month label:

IF DATETRUNC("month", [Date]) != {MIN(DATETRUNC("month", [Date]))}
THEN IF MONTH([Date]) = 4
    THEN "APR"
    ELSEIF MONTH([Date]) = 7
    THEN "JUL"
    ELSEIF MONTH([Date]) = 10
    THEN "OCT"
    ELSE ""
    END
ELSE ""
END

Week 33: What customers make up XX% of sales?

August Community Submission Month

Welcome to community submission month. For all 5 of those weeks we’ll have our favorite community submissions as challenges. FYI: You can still submit here.

 
 

Community Submission Challenge #3: Donna Coles

Donna is located in Didcot, Oxfordshire in the UK. She is a Business Analyst for RM Education and has been working with Tableau for around 5 years. She is Server Admin and oversees the internal Tableau community sharing best practice and providing consultation and training. She has been completing the weekly #WorkoutWednesday challenges since inception in Jan 2017 as they provide opportunities to learn new ways of presenting data that could be applied to a business scenario, as well as often introducing features she hadn’t been aware of. She is also a Tableau Community Forums Ambassador. Don’t forget to follow her on twitter. With that, here is Donna:

Challenge

This weeks challenge is to build a pareto chart to understand what proportion of customers make up sales, and is based on an actual visualisation Donna delivered for a business requirement. There haven’t been many pareto challenges, so hopefully this will give an opportunity for some of you to try a new chart type, but also provide a bit of extra thinking for those that are familiar with them.

click to view on Tableau Public

Requirements

  • Dashboard 800 x 800.
  • Selection of the Sales Percentage slider will adjust the highlighted point.
  • Sales Percentage slider should increment in 10s from 10%-90%.
  • % values displayed to 1 decimal point.
  • The Sales Percentage mark highlighted should be the value that is at least the value selected in the slider (eg when 60% is selected, the mark highlighted is 60.1% as the previous mark is 59.9% which is less than the slider value).
  • The tooltips on the curve differ from that on the highlighted mark.
  • The tooltip on the highlighted mark should also indicate the actual number of customers at that point, as well as the total number of customers.
  • Rebuild everything to be identical, matching titles, tooltips, chart formatting.

 

Dataset

This week uses the superstore dataset for Tableau 2018.1. You can get it here at data.world

 

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday and tag @AnnUJackson, @LukeStanke, @RodyZakovich, and our community contributor @donnacoles30.  (Tag @VizWizBI too – he would REALLY love to see your work!)

 

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

 
 
 

 

Week 32: Coloring Between the Lines

August Community Submission Month

Welcome to community submission month. For all 5 of those weeks we’ll have our favorite community submissions as challenges. FYI: You can still submit here.

 
 

Community Submission Challenge #2: Rosario Irasema Gauna González

Our second community challenge comes from Rosario Irasema Gauna González. Rosario is located in Monterrey, Nuevo León in Mexico. She is the Director of Analysis at Information at the University of Tecnológico de Monterrey. She also a Tableau Public Ambassador and blogs at Rosarioviz. Don’t forget to follow her on twitter. With that, here is Rosario:

The goal of this week’s challenge is to better understand

click to view on Tableau Public

Requirements

  • Dashboard size: 800 x 700.
  • Use per capita calculations.
  • You must be able to select data from a specific country or the world itself.
  • You must be able to select between Ecological FootPrint Production and Ecological FootPrint Consumption.
  • The green line should be biological capacity per capita.
  • The red line should be ecological footprint per capita.
  • If the Biological Capacity is greater than the Ecological Footprint, it means that we have a positive reserve and the area between the two lines must be shaded in green.
  • In the opposite case, it means that there is a deficit and the area between the two lines must be shaded in red.
  • When you move the cursor over the graph subtitles should update to the selected year.
  • When you move the cursor over the graph the subtitle of the difference between Capacity and Ecological Footprint should be green if there is a reserve (+) or red if there is a deficit (-) in the year.
  • Rebuild everything to look identical. Make sure you match titles, tooltips, etc.

 

Dataset

This week uses the Biocapacity vs. Ecological Footprint dataset.  You can get it here at data.world

 

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday and tag @AnnUJackson, @LukeStanke, @RodyZakovich, and our community contributor @rosariogaunag.  (Tag @VizWizBI too – he would REALLY love to see your work!)

 

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

 
 
 

Week 31: Dynamic Color Legend

August Community Submission Month

Welcome to community submission month. For all 5 of those weeks we’ll have our favorite community submissions as challenges. FYI: You can still submit here.

 
 

Community Submission Challenge #1: Sean Miller

Our first community challenge comes from Sean Miller. Sean is located in Kansas City, Missouri in the United States. He’s worked at Cerner – a large healthcare company – in data visualization for nearly the past five years. He’s also very involved in the Tableau Twitter community. Don’t forget to follow him on twitter. With that, here is Sean:

How to Show/Hide a dynamic color legend

This week we’re digging into Tableau’s color legend. In a recent project at work, I was presented with this same challenge. This was a small piece of a much larger dashboard.

 

The client had a requirement that they wanted to be able to flex between different dimensions and different measures depending on the analytic. Among others were simple bar chart and a chloropleth map (Original challenge was down to the zip code).

 

Additionally, the client only wanted color variation on the map. This presented a challenge because best practice tells us that when there is color variation we must have a legend but Tableau legends do not flex dynamically.

 

Your challenge this week is to replicate the standard color legend so that it flexes along with the selections made in the parameters.

click to view on Tableau Public

Requirements

  • Dashboard size: 800 x 800. Total sheets are part of the challenge.
  • Allow users to select between sales and profit as the measure.
  • The map should have the corresponding measure on color.
  • When the map is active, the color legend and min/max values should show. When subcategory is active the legend and values show be hidden.
  • The color legend should be a stacked bar.
  • The title should update appropriately.

 

Dataset

This week uses the superstore dataset for Tableau 2018.1.  You can get it here at data.world

 

Share

After you finish your workout, share on Twitter using the hashtag #WorkoutWednesday and tag @AnnUJackson, @LukeStanke, @RodyZakovich, and our community contributor @kcmillersean.  (Tag @VizWizBI too – he would REALLY love to see your work!)

 

Track your progress

Also, don’t forget to track your progress using this Workout Wednesday form.

 
 
 

#SPOILERS

  • Tableau sorts differently depending on chart type.