Archive

Posts Tagged ‘table calculation’

Date Hierarchies in Tableau

May 31st, 2012 10 comments

I recently had a request from someone who wanted to be able to drill into their data both from Year – Month- Day AND Year – Week – Day. The first of these is very simple as it’s more or less a Tableau default hierarchy from any date field, although the default also includes quarter (Year – Quarter – Month – Day is the default).

Adding Week into this adds a significant degree of complexity for the simple reason that weeks generally don’t span months in a neat way – i.e. it’s only on very rare occasions that the first of the month is also the first day of the week and the last day of the month is the last day of the week. Almost always the end of a month and the beginning of the next will be in the same week number – in other words some weeks will span 2 months.

The first challenge is to create the Year – Week – Day drilldown. To do this a hierarchy actually has to be manually built. In a previous post I described how to build a hierarchy. Making use of calculated fields it’s possible to build on the hierarchy concept to build a Year – Week – Day date hierarchy. Read more…

Tableau Filter the data on display and not the underlying data

May 16th, 2012 No comments

I was recently set a challenge to filter a chart based on something that happened in the past, but still to show all time periods. The specifics of the task was to look at the number of employees a company had in 2010, and depending on that amount either show or hide all years for those companies that had the right amount of employees. In other words create a ‘Number of employees in 2010’ filter.

The dataset contained only 3 fields, Company, Year and Employees.

Initially it seems simple. Create a calculated field to calculate the number of employees the company had in 2010 and use that as a filter. This is what I did, the field was called [2010 Employee Count] and the formula I used was SUM(IF [Year] = 2010 THEN [Employees] END). Next I had to set up the visualisation to test what I created worked.

I dragged the Year to the columns shelf, Employees to the rows shelf and summed it, the Company to the colour shelf, giving me a line graph with annual employee counts over time split by company. This gives me the following line chart:

Next I tested the filter by dragging the calculated field [2010 Employee Count] to the filter shelf and using the At Least filter to show all companies with over X employees in 2010. This is where it became evident that this wasn’t going to work – the filter affected the entire dataset and not only the selected companies as can be seen below: Read more…

Waterfall Charts in Tableau

March 8th, 2012 No comments

I’ve noticed waterfall charts are becoming quite fashionable now. If you’re not sure why this is used, it’s a great way, for example,  of showing how total revenue is compiled from it’s components. Using the Tableau Gantt Chart it’s quite simple to build. In this article I’ll give a very quick guide to building your own such as the chart below.


Read more…

Improve Your Tableau Dashboard Performance

February 29th, 2012 1 comment

I’ve faced a number of issues recently with Tableau report performance not being as good as required. This article is my attempt to combine the different ways to improve the speed I’ve learnt from other sources. The intention is to update this as I learn new techniques to achieve better performing Tableau reports. Read more…

Tableau Top X values by category

February 1st, 2012 No comments

This had me perplexed for a while but I found a good article on the Tableau site about how to show the Top N values by a category. I wanted to find the top 5 regions for a metric in each category.My data set is very simple, it only has 3 fields, the Category and Region dimensions, and the Metric measure.

The first thing I did was to load the Category and Region dimension on to the Rows shelf and the Metric measure on to the Columns shelf to get a column chart. Next I sorted the Region pill by right clicking on to the pill and selecting the Sort option. Read more…

Tableau Create Bins from a Measure Calculated Field- pt 2

August 17th, 2011 No comments

(If using Tableau 9+ check this updated article on using LOD calculations to create bins from a measure.)

This post is a continuation of a previous article showing how to create bins from a measure introducing a situation where data blending is a solution. Credit to Richard Leeke for supplying the solution.

In the previous article we created bins from a calculated field and discovered that when we use these bins they can re-calculate and give us results that we were not expecting. To recap I had some data showing an enquiry count per listing per month. I want to sum these enquiries for each listing to put each listing into a bin dependent on the total number of enquiries it had received over the time period. Read more…