Analytics now and in the future

Some of the fun things that have caught our interest enough to write about.
Timeframe over Timeframe analysis is a constant client request and there are many ways to get there but they’ve always seemed a little clunky. I think this is one of the cooler ways I’ve made it happen, although it’s likely not to get to production anytime soon.
I was doing a datetrunc on Tuesday and wondered if I could put a parameter into the ‘part’ instead of single quotations. Well, you a can. Something I wasn’t aware of. So I did that, and then start mucking around with a dynamic X over X dashboard with the datatrunc determining what the time gap was.
Which lead me to a bar chart with a Parameter action to dynamically compare the a previous time series to the current date.
Here’s the how to:
  1. Let’s start with the date trunc parameter. Call it para date part. It NEEDS to be identical to the acceptable date parts in the time logic. So ‘day’, ‘week’, ‘month’, ‘quarter’, ‘year’. CaSe SeNsItIvE .
  2. Create a Compare Date parameter (just an open ended date param) and a max date calc field -> I use {Fixed : Max([order date])}
  3. As always we’ll need a calculated field to actually use the parameter. Or in this case a handful. In the effort of best practice I’ve made a calc field Date Identifier as: IF DATETRUNC([Para Date Part],[Order Date]) = DATETRUNC([Para Date Part],[Max Date]) then “This Part” ELSEIF DATETRUNC([Para Date Part],[Order Date]) = DATETRUNC([Para Date Part],[Compare to date]) then “Prior Part” else “Other” END
  4. I then made two sales calcs by doing SUM(If [Date Identifier] = “This Part” then Sales else 0 end) … and the same thing for Prior Part. The growth (and any subesequent calc) will then use these calculations
  5. The key element here is a bar chart top right so lets go there. My Rows are Sales, my Colour is that Date Identifier field (‘this part’ on blue, ‘prior part’ on purple, ‘other’ on a muted gray). My columns is another calculated field of DATE(DATETRUNC([Para Date Part],[Order Date])). This changes the axis to group by whichever datepart is selected in the parameter
  6. Note I also have a filter on this page that looks at each parameter option and sets a # of those parts to accepts (so 60 days, 24 weeks, 30 months etc.). This is just so it doesn’t blow up when you pick Days or weeks, but there are other ways around this (including not having one).
  7. Lastly, set up a parameter action so that when you click on a bar, it sends the date to the Compare date parameter. (dashboard -> Actions -> Parameter -> Target is Compare Date, Field is Datepart Axis)
So whenever you click that bar, the Compare date parameter changes. And the compare date parameter is what you’ve build all of your logic off so your prior datepart numbers all change, as does your growth etc. And with the flexibility of the dynamic datepart picker, users can do Month over Month or Quarter over Quarter. You might never have to hear from your end user again.
November 25, 2020

The most user friendly dynamic growth comparison in Tableau

Timeframe over Timeframe analysis is a constant client request and there are many ways to get there but they’ve always seemed a little clunky. I think […]
October 28, 2020

Create a Tableau Drill through Map

A request I often get, and it surprises me that it’s not easier, is being able to click on a Tableau map and have it automatically […]
June 24, 2020

Creating a dynamic, one click email from Tableau

I was messing around with a work book last night and thought about making a click to email action to create an email to my political […]