Home | About | Log in | Get The Feed
Tableau Tips – Building A Calendar-Based View

January

7

2009

It’s a new year and while I’ve effectively been on hiatus from this blog for about 4 months it’s probably time to get started again.

We’ve been using Tableau at work for about three months during which I had something of a rare experience (or at least rare to me). Still being a neophyte with Tableau it was surprising to me that building a simple calendar view of data hadn’t occurred to the Tableau team. Purists will argue (and who’s to disagree) that calendars don’t make the best data visualizations (lack of ability to see trends, low data to ink ration, blah blah blah) but when you have a set of users that prefer a calendar AND everyone is already trained to use/read/interpret a calendar, it’s a compromise I can live with.

Long story short, it was easy enough to build the calendar framework in Tableau but I was still new enough to struggle with getting the data into the calendar in the way that I wanted. So, I reached out to the Sales Engineering team at Tableau (Thanks Ty!) and they he helped me out. The surprising part was the mini-storm of attention that this created on the Tableau team. Apparently this type of visualization hadn’t occurred to them and it created some excitement. What follows is a combination of what I learned on my own and what Ty helped me to create.

For this exercise, we’ll be relying on some of the training data that comes along with Tableau – the ‘superstore data’.

This post is pretty in-depth (and long) but it assumes that you have a working knowledge of Tableau and SQL. If you are new to either or both, some of this may not make sense.

Set 1: Getting Set Up

  1. Open Tableau
  2. Start a new workbook
  3. Connect to “Sample -Superstore Sales” Excel file

New Tableau Workbook - Superstore Sales

 

 

 

 

 

 

 

 

 

 

You may see some different dimensions and measures in here than what you see in your workbook. There are two reasons for this, there are a couple of custom dimensions and measures that we need to create along the way AND you may have a different version of this file than I do.

Step 2: Building the Calendar Framework

  1. The first thing we need is a custom dimension, not because we’re going to use it right away but we will need it later for building in some interactivity and it’s part of the calendar framework. this dimension will be called “YYMM” and is a simple concatenation of the 2-digit year and 2-digit month from the Order Date dimension.Tableau Calculated Field Dialog Box

     

     

     

     

     

    This simple dimension is simple a string and will return values like ’0801′ (e.g. January 2008)

  2. Setting the stage…
    1. Right-mouse click and drag the “Order Date” dimension to the Columns pane. This should prompt you to select the type of aggregation to use – select “WEEKDAY(Order Date)”. This will get you your days of the week running across the top.
    2. Now drag “YYMM” to the Rows pane, followed by “YEAR(Order Date)” (which is the default aggregation for date dimensions), “MONTH(Order Date)” (remember that right-mouse drag?) and “WEEK(Order Date)”

      Right now you have a table that should look something like the following:Tableau Calendar Table

     

     

     

     

     

     

     

  3. Making the table into a calendar
    1. In the “Marks” pane, change the Marks drop down to “Square”
    2. Make a new custom dimension called “Day” with the formula DAY([Order Date]) (Make sure that day is in the Dimensions pane and not the Measures pan after creating it)
    3. Drag “Day” to the “Level of Detail” box in the “Marks” pane

      Now the Tableau stage probably looks something like this:

      tableau calendar 2

       

       

       

       

       

       

       

    4. Let’s put in a quick filter so that we can look at just one month, we’ll remove the filter later. Control drag (CTRL+Drag) “YYMM” from the Columns pane to the “Filters” pane. Put a check mark on “Exclude” and then scroll to the end of the list and take the check mark off of “200812″. Now we’re just looking at December 2008. Still doesn’t look like much of a calendar does it? But it’s in there.
    5. We just have to manually adjust the size of the stage and the cells to get what we are looking for.
      1. Find the up/down handle on the Week of Order Date cell and drag it down so that the row height is about 1.5″
      2. Do the same for the Day of Week Columns. We’re now getting closer, you can probably start to see the calendar format:tableau calendar table 3

         

         

         

         

         

         

         

         

      3. Add borders to enhance the calendar effect. Go to Format –> Borders
        1. Add a black, narrow border to Cell under the Default section of the Sheet–>Borders pane
        2. Ass an added bonus you can now fine tune your column width and row height to a square

        Your Tableau stage should now look an awful lot like a calendar, albeit an ugly blank one:tableau calendar table 4

         

         

         

    6.  

       

 

 

 

 

 

Step 3: Adding Data and Visual Analysis Cues

So now we have our basic calendar structure but there is no data in it and let’s face it, it’s U-G-L-Y. Let’s start by adding data.

  1. For the purpose of this exercise, we’re going to assume that we want to keep track of total sales (Gross Revenue) and Profit. We also need to add the day of the month to each cell. Initially, I had gone down the road of using Tableau annotations to create this but it’s cumbersome and breaks whenever the dates change. So the biggest thing that Ty in Sales Engineering helped me with was a custom measure that contained the Day of the Month, the total Sales and the Profit.
    1. So, we’re going to create a custom measure called “Day Calc” that concatenates the day of the month, the Sales total and the Profit total. The formula looks like this:

      str(MIN(DAY([Order Date])))+”

      s: “+str(round(SUM([Sales]),2))+”
      p: “+str(round(SUM([Profit]),2))

    2. Now, drag “Day Calc” from the Measures pane to the “Text” field in the Marks pane
    3. Right-mouse click a date cell and go to Format. Set the vertical alignment to “Top”. Horizontal alignment is your choice, as long as it’s left or right ;) tableau calendar table 5

       

       

       

       

       

       

       

       

       

       

       

      Ok, now we have actual data in the calendar, but what’s up with the color? The blue ain’t helping – maybe we should do something about that?

  2. Use color as an indicator of health
    1. Drag “Sales” from the Measures pane to the “Color” field on the Marks pane
    2. In the new “Colors” pane that appears below Measures, click the down arrow and select “Edit Colors”
    3. In the new dialog box, change the palette from “Automatic” to “Red-Green Diverging
    4. Put a check on “Stepped Color” and change the number of steps to two (2)tableau calendar table 6

       

       

       

       

       

       

       

       

       

       

       

      The colors, which are splitting on the average revenue in this scenario, are still quite a bit saturated though.

    5. Change the opacity of the cell colors
      1. Back in the Marks pane, drag the opacity slider under Color to the left to increase the transparency of the color in order to desaturate the displaytableau calendar table 7. Find a level you’re happy with it and go!

 

 

 

 

 

 

 

 

 

 

Step 4: Cleaning It Up

Now we have a calendar that gives us useful information and visual cues to the health of a particular day – hooray! But there is still a lot of stuff chart junk showing that we don’t necessarily need to show.

Things that can probably be hidden (not removed because they are either needed to maintain the calendar framework or we will need them later to create interactivity).

  1. YYMM can be hidden
  2. Week of Order Date can be hidden

    These two items can be hidden by clicking on the dropdown arrow in their respective lozenges (yes their called lozenges) in the Row shelf and taking the check mark off of “Show Header”

  3. Additionally, we can remove the row headers. Right-mouse click on “Order Date” in the stage and select “Hide Field Labels for Columns” – Order Date should disappear. Right-mouse click on either “Year of Order Date” or “Month of Order Date” and select “Hide Field Labels for Rows” and both of those should now be hidden.
  4. You may want to resize the Year and Month columns at this point but keep them visible because in the next post we’ll be making this calendar interactive so you want to make sure and indicate which month and year is being viewed
  5. VIOLA! A calendar based view in Tableau:Completed Tableau Calendar View

 

 

 

 

 

 

 

 

 

 

Stay tuned for the next post in this series where we’ll discuss taking this view and making it interactive!

 

 

Here’s an updated version of the calendar that I did when speaking to the Atlanta Tableau User Group:

Tags: , ,

12 Responses to “Tableau Tips – Building A Calendar-Based View”


Hi Clint, I didn’t know you were a new Tableau convert. I love that product and I’m impressed (but not surprised!) with what you’re already able to do. Looking forward to your future posts about Tableau.


Hey Jacques! Yeah, color me converted! Thx. for the props. I am really enjoying Tableau. Can’t wait to get my hands on server ;)


New at Instant Cognition: Tableau Tips: Creating A Calendar Based View – http://is.gd/eSiT


Nice post Clint. Tableau is a great tool and has a lot of nice features. Mix that with your creative and presentations skills and the combo will be really powerful. Keep it coming :)


Hey Ali – tons of nice features. Really like not being reliant on BI for quick investigation of data. There will definitely be more to come.


Hey Clint, great post! Thanks for stretching the software. Did you consider showing a different time-series view along with this and gradually working your users off calendars?

By the way we gave you a shout-out in our blog: http://www.tableausoftware.com/blog/calendar-data-visualization


Hey Ellie! Thanks for the shout-out.
I’m not migrating users to a different view per se and here’s why:
1. The calendar is used in planning meetings and since these planning meetings tend to revolve around specific events, the calendar works well for that
2. In the next post I’ll discuss the interactive bits that Ty really shone on and we use more purist visualizations of the same/related data. So we have multiple views on the same data that is easy to get to and thus gives a more wholistic picture.
3. As a general principle, I look for visualizations that have the least friction (lower barrier to entry). In other words, bullet graphs are great but they require training someone how to view it. This often leads me to use visualizations that theorists and purists alike will often look down their nose on. I even use the dreaded pie chart (with restrictions) in some cases because a) every MBA in the world is comfortable with them and b) a high degree of accuracy is not required – used most often to answer “Bigger than a breadbox and smaller than a Volkswagon” type questions. (Ok so all you purists and theorists can go hog wild now – I can take it)


I’m throwing cream pie charts at you!!


Mmmmmm. yummy! We should host a contest for the best pie chart – made from pie!


Earlier this week I posted this note on the Tableau blog regarding your calendar view, and wondered if you had any thoughts about it?

Here is an image of a variation on the theme. It illustrates the opportunity to fill cells conditionally based on the values in another field. In this case, the color of each day is based on a calculated field: [Day_color] = MAX([Region]). MAX(Region]) is now also part of Clint’s inventive/mind-blowing original [Day Calc] calculated field, which now reads:

str(MIN(DAY([Order Date])))+”

s: “+str(round(SUM([Sales]),2))+”
p: “+str(round(SUM([Profit]),2))+”
Max p: $”+str(round(max([Profit]),2))+”
“+str(max([Region]))

Best as I can tell, [Day Color] resolves to the [Region] with the MAXimum profit for the [Day] in question. If I am mistaken, it was worth a try. Otherwise, kewl!

This approach might be of some help to Jawon, in answering his question on the Tableau Desktop Basics Forum, which was:

“If I have a variable in the Text shelf, is there a way to conditionally format the background of a cell? For example, I have the State variable in the Text shelf. I want the cell background where State=”IL” to be red. Possible?”

Whaddyathink?

MANY BLESSINGS!
Peace and All Good!
Michael W Cristiani
Market Intelligence Group, LLC


Michael,
thanks for the addition to the work. I can’t take credit for the DayCalc field though – that was one of Ty’s best contributions.


[...] in January, I published a post on how to create a calendar-based view in Tableau. At the time, I mentioned that it had created some buzz within the halls at Tableau-central and [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

prednisone buy cod watson brand order prednisone on line purchase online prescription prednisone prednisone 10 mg buy prednisone with no rx prednisone overnight cod prednisone ups how to purchase prednisone online without a prescription purchasing prednisone online without prescription overnight prednisone purchasing prednisone without a script how to get a prednisone prescription safety order Paxil order Paxil pharmacy purchase Paxil online without script order Paxil cheap overnight purchase cheap Paxil cod free fedex Paxil fedex no prescription purchase Paxil online with overnight delivery Paxil without prescription shipped overnight express buying Paxil over the counter buy Paxil without a rx overnight shipping Paxil overnight delivery fed ex how to order Paxil online without a rx order Paxil overnight cheap purchase online Paxil without prescription purchase Paxil online no membership buy Paxil 40 mg online buy cheap fedex Cytotec prednisone with free fedex overnight purchase prednisone visa buy 40 mg accutane online without prescription how to purchase Lasix online without a prescription website design software download download bluetooth software buying rediker software bitcomet software download software educational prices plagiarism software to buy for parents fedex Crestor overnight without a prescription buy spyware software sony ericsson software downloads graphic software cheap discount for webwatcher software discount on ezfiling software tally software download cheap software downloads accounting software downloads iden software download discounted student software lowest price on 2008 tax software wilcom software download adobe connect pricing Online us prednisone cheap mac adobe oem software Lasix buy online in stock download a free of creative suite 5.5 design premium purchase xenical without prescription to ship overnight xenical 120 mg online cheap Maxalt usa buy cheap Maxalt online free consult prescription Zithromax where to purchase Valtrex no prescription no fees purchase Valtrex online online overnight shipping valtrex buy valtrex in mexico valtrex 1000 mg (no prescriptions needed for Buspar|buy Buspar with no prescription|online pharmacies Buspar|Buspar cheap|buy Buspar without rx|purchase rx Buspar without|Buspar purchase online|purchase Buspar online without rx|purchase Buspar free consultation|buy Buspar Online|buy Buspar american express|buy Buspar Online|buy cheap Buspar with dr. prescription|Buspar side effects|fedex Buspar without priscription|overnight Buspar without a rx|order cheap overnight Buspar|Buspar toronto|uk order Buspar|Buspar no doctors prescription|Buspar mexico|Buspar order|no prescription Buspar with fedex|order generic Buspar|buy Buspar without rx from us pharmacy|prezzo Buspar|Buspar 10mg|Buspar from canada|purchasing Buspar without a script|buy Buspar australia|purchase Buspar visa without prescription|online purchase Buspar|buy Buspar no perscription cod|buy Buspar drugs|buy Buspar with visa|buy Buspar without rx needed|buy Buspar without prescription|buy Buspar no prescription low cost|purchase buy cheap generic Buspar how to buy Nolvadex without a prescription i want a Nolvadex prescription ms works 2011 buy online rx Lasix without cheap order rx Lasix purchase 10mg accutane 40 mg overnight delivery Nolvadex same day delivery Bupropion buy on line buy synthroid mail buy buy synthroid online pharmacy risperidone Nolvadex compare at Bridgend Accutane 20mg mexico purchase Lasix paypal without prescription order online zithromax without prescription zithromax delivered cod fedex purchase no perscription Nolvadex Nolvadex without prescription overnight shipping order Nolvadex now buy Nolvadex online without prescription Nolvadex without rx cheap buy Nolvadex cod next day delivery buy zithromax offshore no prescription fedex order 250 mg zithromax overnight delivery zithromax without rx medications zithromax generic fedex no prescription buy zithromax no scams online pharmacy cod zithromax purchase zithromax amex online without rx Orlistat online order finpecia to buy buy mail order Orlistat where can i buy Valtrex without a rx cheap generic Finpecia generic finpecia online finpecia usa finpecia 1mg maxalt without a presciption purchase Valtrex pay pal online without rx buy genuine Buspar Buspar purchased online without prescription buy prednisone online without a prescription prednisone with no perscription overnight shipping best buy valtrex comprar Crestor generico Valtrex free consultation u.s. pharmacy Valtrex online no perscription fedex buy cheap Zithromax order buy Zithromax online where can i purchase Buspar no rx buy Arimidex without a rx Arimidex suppliers buy online without a prescription cheap Cytotec Cytotec cost best buy adobe flash for web editing adobe forms buy no perscription Buspar rosetta stone software price adobe photoshop lightroom 2 adobe acrobat palm pocket pc adobe acrobat buy accutane 40 mg discount Crestor purchase online buy microsoft access 2003 upgrade canada Tamsulosin office 2003 oem slipstream sp1 office 2007 recycle mac adobe upgrade ordering Crestor without a script buy Crestor on line Crestor without prescription adobe acrobat courses installing office 2003 over 2007 order Orlistat overnight Orlistat order online Orlistat buy adobe photoshop cs3 updates Autocad 2011 Slow Autocad 2010 Review after effect 9 physical page frame e0b884e0b8b7e0b8ad buy Flomax without rx license code hack strata design Windows 2000 Service Pack 3 Windows 7 Upgrade Student Price buy Valtrex no prescriptions Flomax online no prescription order Buspar order amex how to purchase Valtrex online without a prescription order Orlistat without rx from us pharmacy wordperfect x4 professional oem Buspar online Proscar online where to purchase cheap Flomax no rx belvedere ice room whistler full edius pro 4.6 download visual studio 2010 download full version ars longa vita brevis occasio praeceps photoshop 7elements training dvds torrent mental ray standalone 2012 order Crestor no visa purchase Prednisone online without prescription price nuance omnipage 17.1 Buy Fincar amex buy quicken software android acdsee buy cheap valtrex online free consult cd microsoft office 2007 Flomax overnight cod Valtrex best buy Flomax cheap buy Zithromax with a visa buy Flomax now virtual dj software pro 7 download buy Tamsulosin online no prescription want to buy Buspar in usa cheap way of windows7 license Buspar no prescription where can i buy Maxalt without prescription Valtrex bestellen order overnight Zithromax Amitriptyline by mail Zithromax purchase cheap online prednisone prednisone fedex 3d home architect broderbund windows 7 64bit sql server 2008 r2 datacenter Photoshop 2 Windows For Students Download Free Adobe Reader 9.0 photoshop old version download Orlistat tablets purchase Valtrex amex online without prescription purchasing Valtrex online without prescription Buy Cheap Windows online valtrex Windows 98 achat Buspar Prednisone no prescription to buy buy in Zithromax uk best buy accutane 40 mg valtrex prices Autocad Educational Version Upgrade Microsoft Office 2003 To 2007 generic Buspar usa adobe audition2 buy in Valtrex uk web application microsoft office mini photo resizer download generic Prednisone usa finpecia overdose purchase Valtrex without prescription from us pharmacy purchase Cytotec without rx needed fedex Prednisone overnight without a rx prednisone with no perscription overnight shipping Windows 7 Ultimate 64 Bit Student Discount Discount Microsoft WindowsLightroom 2 Windows 7Ms Office StandardPhotoshop Cs5 UpgradeComputer Monitors For SaleWindows Xp InstallSuite Microsoft OfficeAutocad Version 2007Adobe Acrobat 9.0 Standard DownloadIe8 Download For Windows 7Adobe Paint ShopMicrosoft Service Pack 2Free Download Adobe AcrobatStudent And Teacher EditionManage ImageAdobe Acrobat 7 Pro DownloadVista Home Premium To Windows 7 UltimateWindows 7 Home Premium Upgrade OemAdobe Creative Suite 5 Master Collection Student And Teacher EditionBuy Adobe Photoshop Lightroom 3Ms Office 2010 Home And StudentCompare Photo SoftwareMicrosoft Office Word Viewer 2010Windows 7 Upgrade Student Discount ProfessionalWindows 7 Updates DownloadCreative Suite WebAdobe Reader VistaMicrosoft Windows 7 Home Premium Upgrade 64 BitPhotoshop 2Ie8 Download For Windows 7Photoshop 2009Suite Microsoft OfficeMicrosoft Office 2007 VersionUpgrade Windows Vista To 7Autocad Lt 2010Autocad 2010 Best PriceDownload Acrobat Reader 8 buy Flomax cod next day delivery buy generic Valtrex pills Buspar overnight cod ordering Valtrex over the counter buy Valtrex diet pills what does Valtrex look like Proscar rezept order Proscar cheap overnight Cytotec canada purchase Cytotec cod next day delivery buy Prednisone with visa Prednisone buy Prednisone purchase Proscar without rx to ship overnight Valtrex no doctors prescription buy cheapest valtrex Valtrex perscription from s online chemical name buy Cytotec buy finpecia no prescriptions finpecia wholesale buy Cytotec quantity buy genuine finpecia finpecia free consultation fedex overnight delivery Buy Finpecia 1 mg online microsoft vista price cut window bottom repairing windows windows archive microsoft window update microsoft keyboard 4000 buy oregon cheap used pos software windows mobile 5 software where to buy microsoft office professional 2007 sp3 windows xp window vista ultimate microsoft office 2003 pro oem discount no prescription Orlistat Rosuvastatin overnight cheap Flomax online buspar online no perscription fedex design landscape software sec discounted cash flow software windows science cvs server windows