Author: graphhopperblog

# Table Calcs – TC 17 Takeaways

Just got back from Tableau Conference 2017! I’m putting together a teach-back for work, and figured I would share it here too!

At the conference I attended these Hands On sessions:
Advanced Calculations – 8 hour paid class
Table Calcs for the advanced analyst
Tableau + Python = ❤
LOD Expressions vs. real world

You can access workbooks and other materials from the sessions for free at TClive.

### All Table Calculations have three basic parts

• An aggregated field (Blue)
• Values used in the calculation
• Calculation Type  (Orange)
• Calculation to Perform
• Compute Using  (Green)
• Scope and Direction of Calculation

Some Calculation Types have additional options, allowing you to change the order, computation, or add a secondary calculations.

### Understanding the Compute Using menu is key

Compute Using determines Scope and Direction
Michel Sandberg’s site datavizblog.com has a great guide for scope, including some awesome visuals that I’ve borrowed below

Scope:

Direction:

Note – Compute Using Options handle Null values inconsistently. See Workbook

This slideshow requires JavaScript.

Calculation Assistance is super helpful! It will highlight the scope of your Table Calc, and for most marks, the order of the values. The value order might not appear if the mark type is text.

Compute Using Specific Dimensions allows more control over scope and direction.

Selecting Specific Dimensions enables a box with a checklist of dimensions from the view. Unselected dimensions act as Partitioning Fields.

The order of the selected dimensions determines the direction of the Table Calculation. Drag and drop dimensions within the box to re-order.

This slideshow requires JavaScript.

If you use Specific Dimension, you may need to manually update the settings when adjusting the dimensions in your view.

### Using Table Calcs in Calculations

After creating a table calculation, drag it into the data pane to turn it into a calculated field. From there, you can edit the calculation and add on to the calculation.

Scope and direction will still be adjusted through the Edit Table Calculation menu.

### Using Table Calculations as Filters

Once you turn a Table Calc into a Calculated Field, you can use that field as a filter. Unlike any other filter, Table Calculations must be completed before Table Calc filters affect the view. This means that Table Calc filters are uniquely suited for situations where we need a subset of the underlying values to feed into Table Calculations, but don’t want to actually see them in our view.

For example, this Table Calc is comparing quarterly sales to the previous year.

The Table Calc for 2012 is null because there’s no 2011 data to calculate off of. Filtering Order Date to remove 2012  would prevent the Table Calcs from using 2012 values to generate 2013 results. In this case, we could hide 2012 from the view, but if the view had interactivity that impacting the starting point, a Table Calc filter would be a more dynamic choice.

# Makeover Monday – Functioning Toilets in Indian Schools

Really quick makeover this week! I took the original filled map, changed the color palette, put years on pages, added a line graph and some context.

# Dear Data week 4 – Mirrors

This week’s data was collected July 23-29

Data Gathering

I recorded day, mirror used, features I focused on, whether I made a face, and positive/negative thoughts. I make a lot of goofy faces when I’m alone! Most observations were from the car or the work bathroom; the mirrors at home are hard to accidentally glance at. There was one group picture – does that count?

Data Memories

This week was super timely. As the week started I had a massive acne outbreak on one cheek. It’s the worst one I’ve had in ages and I found myself obsessively checking it each car ride and bathroom visit. I also found my first gray hair this week! Did you know that a single strand can change colors partway down?

Data Drawing

All that data, but sometimes simpler is better. The features I focused on and the positive/negative thoughts felt so much more important than the other values.

# Dear Data week 3 – Thanks

This week’s data was collected July 16 – 22.

Data Gathering

Tracking thank yous is so difficult! I could check emails and text messages, but noticing thank yous in conversations was really hard. I’m sure that I missed some, but regular reminders to record data minimized it. I even noticed when NPR thanked me for listening!

Data Drawing

The data I collected has a lot of features, with a lot of connections. I was really interested in connections and distance, and originally wanted to try using a network diagram to show the data. Because I can’t accurately represent the connections between others, this turned into a sunburst. The sunburst became a flower – a traditional representation of a thank you, with more room for notations.

# Dear Data week 2 – Transportation

This week’s data was collected July 9 – 15th.

Topic
My transportation data is pretty boring; I mostly drive myself around. The week I recorded this data was also super hot and humid, so I walked even less than usual. This visualization focuses on geographic data – including areas that I didn’t visit. The area north of Delmar is incredibly segregated. Including all of that empty space didn’t feel great, but it’s a necessary reminder that my world has become a lot narrower. A place like this requires regular, conscious effort to break out of your own bubble.

Data Gathering
Because of my boring travel habits, gathering this week’s data was dead simple! I recorded each place I visited, and made some simple notations on any unusual trips.

Data Drawing
My original plan did not include any streets, but I decided to include Delmar after realizing that I visited the East, South, and West edges of the city but didn’t touch the North side. Additionally, the boulevard tells the viewer that they are looking at a map, and provides a reference for location and scale. My first draft of the card was more subtle. Flipping the orientation, adding more white space to the top, and changing Delmar from black to red made the white space more dramatic.

The scale on the circle sizes is a bit odd. I went with 1, 4, 16 because my stencil lists circles by diameter. Doubling the diameter of a circle quadruples the volume, so 1, 4, 16 allows me to use the stencil and have an accurate volume scale. (Do they make area based stencils? If they do, I should get one.)

Process

# Makeover Monday – White House Salaries

This week’s Makeover Monday challenge compares Trump’s 2017 staff salaries to Obama’s staff salaries in 2016.

Here’s the original:

After looking at the ridiculously detailed data (seriously – it has names!) the salaries are awfully low. Analysts in the White House are making 42k, which is below market, even in the Midwest. On the whole, Trump’s staff has fewer members and higher salaries, which is not surprising – Obama’s staff was mustered four years before Trump’s. The big difference is in the distribution. Obama’s salaries have a nice stair step progression while Trump’s are flatter.

Here’s my makeover:

This week’s makeover is a simple jitter plot, with administration on color. It’s actually the first view I created for this data, but I think it’s quite telling. Trump’s points form several vertical lines, with one especially strong line at 115k. Obama’s points look more random, though there seem to be a few vertical lines between 40k and 50k.

I’m not sure why Trump’s salaries are clustering at certain values (perhaps pay grades?) but it certainly points to a difference in strategies for setting salaries.

# Dear Data week 1 – Time

I learned about the Dear Data project from a session about Dear Data Two  at the 2015 Tableau Conference. (The On Demand sessions are amazing AND free! If you’re interested in Tableau you should check them out right now.) The original project is a year long series of weekly postcards exploring personal data. The postcards are gorgeous, blurring the line between numbers and art. The creators (Georigia Lupi and Stefanie Posavec) use creative methods to pack insane amounts of information into a tiny space. The Dear Data Two presenters (Andy Kreibel and Jeffrey Shaffer) took the topics from the original project, made their own postcards, and then built them in Tableau. (This talk also lead me to Andy Kreibel’s blog, and Makeover Monday!)

I began recording data for this project Sunday July 2nd, 2017, which conveniently lands a week from my birthday and right next to the midpoint for the year.

Topic
This week was all about time and clocks. I’m interested in my perception of time, so I made predictions and then checked the actual time. My predictions include a range (it’s between 11:30 and 12:00) and an exact guess (11:45). I also recorded the exact time and the clock used.

Data Gathering
I recorded all of this week’s data in my everyday notebook and tried to keep the notebook open to that page and visible to remind me to make guesses. There’s a big red stop sign in the corner of the page to keep me from checking the time before guessing, which happened a few times anyway! I tried to make a least three guesses each day, recording the range, exact guess, actual time, along with the clock used to verify the time.

Data Memories
Tuesday was a holiday, which made data gathering tricky, every other day has 3+ records.
Once I guessed the exact time to the minute!!
From the data it looks like I’m most aware of the time in the afternoon, which matches my experience – I check the time a lot right after lunch! The huge gap between 3 and 9 on weekdays makes sense too. I’m pretty busy during that time – wrapping up projects, running errands, going to class or making dinner.

Data Drawing
There are a couple mistakes in the drawing, but overall it looks pretty good! I got lucky – the 3:00 – 9:00 gap in the middle of the week allowed me to fit everything onto one side of the postcard. It was surprising how many little choices went into designing the card.  Should I include all 24 hours, or just the relevant ones? Should the card end at one, or at midnight, wrapping around to the next day? How should I show the exact guess and exact time? I think this project will definitely help with my design skills!

Process