Posts by Luke Stanke

2019 Week 9: Can you remove the scroll bar?

When I started Workout Wednesday I made a list of potential challenges. This challenge was the second challenge I wrote down. After more than 20 challenges I’ve finally gotten around to sharing it!

Challenge


Click to view on Tableau Public

Requirements

  • Format: 1000px by 600px
  • Create a visualization with bar charts that show total sales, total profit, and total quantity by city-state (See below for state abbrevation calculation). Sort by sales.
  • Create a calculation that you can use as a filter that shows cities in groups of 10. Make sure the labels based on the rank i.e. the top ten are 1-10, the 2nd 10 are 11-20, ect.
  • Make sure the bar size remain proportional with the maximum value for each. Do not used a fixed axis.
  • Add a zero line for profit only.
  • Match formatting: Size 11 font, bar color #ED7470.
  • 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, and @curtisharris_!

    Track your progress

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

    Attribute

    When you publish your solution on Tableau Public make sure to take the time and include a link to the original inspiration.


    Abbreviation Calculation

    CASE [State]
    WHEN "Alabama" THEN "AL"
    WHEN "Alaska" THEN "AK"
    WHEN "Arkansas" THEN "AR"
    WHEN "Arizona" THEN "AZ"
    WHEN "California" THEN "CA"
    WHEN "Colorado" THEN "CO"
    WHEN "Connecticut" THEN "CT"
    WHEN  "Delaware" THEN "DE"
    WHEN "District of Columbia" THEN "DC"
    WHEN "Florida" THEN "FL"
    WHEN "Georgia" THEN "GA"
    WHEN "Idaho" THEN "ID"
    WHEN "Illinois" THEN "IL"
    WHEN "Indiana" THEN "IN"
    WHEN "Iowa" THEN "IA"
    WHEN "Kansas" THEN "KS"
    WHEN "Kentucky" THEN "KY"
    WHEN  "Louisiana" THEN "LA"
    WHEN "Maine" THEN "ME"
    WHEN "Maryland" THEN "MD"
    WHEN "Massachusetts" THEN "MA"
    WHEN "Michigan" THEN "MI"
    WHEN "Minnesota" THEN "MN"
    WHEN "Mississippi" THEN "MS"
    WHEN "Missouri" THEN "MO"
    WHEN "Montana" THEN "MT"
    WHEN "Nebraska" THEN "NE"
    WHEN "Nevada" THEN "NV"
    WHEN "New Hampshire"	THEN "NH"
    WHEN "New Jersey" THEN "NJ"
    WHEN "New Mexico" THEN "NM"
    WHEN "New York" THEN "NY"
    WHEN "North Carolina" THEN "NC"	
    WHEN "North Dakota" THEN "ND"
    WHEN "Ohio" THEN "OH"
    WHEN "Oklahoma" THEN "OK"	
    WHEN "Oregon" THEN "OR"
    WHEN "Pennsylvania" THEN "PA"
    WHEN "Rhode Island" THEN "RI"
    WHEN "South Carolina" THEN "SC"
    WHEN "South Dakota" THEN "SD"
    WHEN "Tennessee" THEN "TN"
    WHEN "Texas" THEN "TX"
    WHEN "Utah" THEN "UT"
    WHEN "Vermont" THEN "VT"
    WHEN "Virginia" THEN "VA"
    WHEN "Washington" THEN "WA"
    WHEN "West Virginia" THEN "WV"
    WHEN "Wisconsin" THEN "WI"
    WHEN "Wyoming" THEN "WY"
    END
    

2019 Week 5: Where are the biggest discounts?

I recently put together this chart for work. I spent more time making it amazing than I am willing to admit, this is mostly due to the amount of formatting I did. I thought I’d make a formatting challenge this week!

Challenge


Click to view on Tableau Public

Requirements

  • Format: 540px by 800px
  • Create a heat map of average discount by sub-category and region.
  • Labels for region should be below the heat map tiles.
  • Use Tableau Light, Size 7 for the tile labels.
  • Use Tableau Light, Size 8, Color #555555 for the column and row labels.
  • Sort sub-categories within each category by average discount.
  • Use Tableau Medium, Size 9, Color #898989 for the category header label.
  • Add bars above and to the right of the heat map indicating the average discount for sub-category and region.
  • The bars should be approximately 2px away from the heat map tiles.
  • Make sure the bar sizes are identical.
  • Add labels to the right of the bars for the bar chart to the right of the heat map.
  • Add labels above the bars to the bar chart above the heat map.
  • Use Tableau Light, Size 9, Color #555555 for the bar labels.
  • Set the color range for all objects to be between 0% and 50%.
  • Create a custom sequential color palette. Use #4A4E68.
  • Add just a tiny amount of white space between each heat map tile (~1px).
  • Add a divider between categories for the entire visualization set. Use #D4D4D4.
  • Add padding of 80px to the left of the visualizations and 50px to the right.
  • 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, and @curtisharris_!

    Track your progress

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

    Attribute

    When you publish your solution on Tableau Public make sure to take the time and include a link to the original inspiration.


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.