Archive

Posts Tagged ‘parameter’

Simple way to add All to a parameter in Tableau

October 3rd, 2016 No comments

Back in 2012, I wrote a post describing an overly complex way to add ‘All’ to a parameter in Tableau. It is surprisingly simple to add All to a parameter if using the parameter to select a value from a dimension.

First create a patameter and add the values from the field and the value All.

Next create a calculated field to use the parameter. The generic formula to use ‘All’ in a Tableau parameter is:

[Parameter] = ‘All’ OR [Parameter] = [DimensionName]

The following is a very simple example based on the Superstore data. In this example the Segment is selected from a parameter, called SegmentParameter. Read more…

Categories: Tableau Tags: ,

Add an All to a parameter in Tableau

November 12th, 2012 6 comments

EDIT 3/10/16: A different and simpler way to add All to a parameter in Tableau is written in a new article.

 

I have to thank Ben Sullins for this and his post on how to add an All to a parameter in Tableau, finding that article saved me a lot of time.

To begin create the parameter and add an ‘All’ option. Display the parameter on your worksheet.

Next drag the field you want to filter to the filters shelf.

To filter the field using the parameter right click on the field on the filters shelf and select Filter, then Condition.

In the By Formula box enter the following formula:

IFNULL([FilterField],’Null’) = IF [Paramter] != ‘All’ THEN [Paramter] ELSE IFNULL([FilterField],’Null’) END

How does this formula work? Read more…

Categories: Tableau Tags: , , ,

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 Dynamic Sorting

May 28th, 2012 19 comments

Recently I created a tabular report where it was a requirement for the user to be able to sort the list by all of the different measure columns. I generally publish my reports on to Tableau Server where sorting is easy by using the Tableau toolbar but I wanted to see how to do this without using the toolbar.

I began to think about ways to do this using parameters and calculated fields as a Dimension has the option of Sort By Field. Luckily I didn’t have to think to hard about how to do this as I stumbled across a blog post which describes how to set up dynamic sorting with Tableau. I slightly modified the more complicated of the 2 techniques described in that article, which I describe here.

For this example I’m going to use the Superstore Sales sample data Tableau provide and create a table showing the Customer State on the rows and the measure values Profit, Profit Ratio and Sales in the columns. If unsure how to do this check my other post on displaying data in tableau as a table. Read more…

Tableau Server Passing Parameters in the URL

February 6th, 2012 3 comments

If using Tableau Server it’s possible to pass parameters to filter your dashboard via the URL. It’s very straightforward and detailed in this post on the Tableau Forums. Basically just get the URL to access the dashboard on the server, add a ? at the end, which is how parameters are entered in a URL. After the ? put either the name of the parameter or the name of the field being filtered, =, and then the value.

For example if you want to filter/pass an email address parameter – field/parameter name being EmailAddress – your URL would be as follows: http://ServerName/views/WorkbookName/ViewName?EmailAddress=andrew@reports4u.co.uk

To add multiple of the same filter use a comma (,). For example to filter for 2 EmailAddress’s use the URL: http://ServerName/views/WorkbookName/ViewName?EmailAddress=andrew@reports4u.co.uk,admin@reports4u.co.uk

Note this is case sensitive so make sure this is taken into account. To add additional parameters add an ampersand (&) to the end of the URL for each parameter/filter and the same Name=Value syntax. For example to filter the view for EmailAddress and ReportYear you could try the following:
http://ServerName/views/WorkbookName/ViewName?EmailAddress=andrew@reports4u.co.uk&ReportYear=2012

Basic Maps in Tableau

December 23rd, 2011 2 comments

I’ve been meaning to write about the maps in Tableau for some time now as I’m really impressed with how they look, how easy they are to use and how powerful they are as a visual geographic reporting tool.

If you have geographic data, preferably with a longitude and latitude, you can display mapped data in a matter of minutes. Tableau maps allows zooming in and out – although this isn’t the most user friendly when compared to the likes of Google maps. Read more…

Tableau Dynamic Linked Parameters

November 26th, 2011 3 comments

The first thing to tell you is this isn’t possible, one of the few weaknesses in Tableau.

I wanted to set up 2 parameters in Tableau, the first would be a start date, the second an end date. What I wanted to do should be straightforward – to set the values available in the end date based on what was selected in the start date parameter – so the earliest date available in the end date parameter is the same as the value selected in the start date parameter.

The first thing I did was create a calculated field to return values based on the result of the start date parameter – i.e. If  Date >= Start Date parameter Then Date End. I used this calculated field to set the min and max date range in the parameter and thought that would be parameter set up complete. Read more…

Omniture visits report in Tableau – part 2

This post is a continuation of part 1 on how to create the Oniture visits report in Tableau. Click here to go back to part 1

This is the chart we are trying to create, the same as the Omniture calendar month visits report.

Now we can begin to create the chart. Drag the Day pill to the Columns shelf and the calculated field SelectedMonthVisits on to the Rows shelf. Make sure the Day pill is displaying the DAY(Day). Read more…

Omniture visits report in Tableau – part 1

To recreate the Omniture visits report in Tableau was quite difficult so I’ve broken the post into 2 parts. The result will be published on Tableau Public and I’ll supply the link to the report at the end of the post.

I spent some time recently trying to replicate web traffic visit data from Google Analytics in the style of the Omniture visits report. I like the Omniture visits report as it shows how you’re tracking in the current month vs how you were tracking exactly 4 weeks earlier – i.e. compares Monday with Monday, Friday with Friday, etc. It also shows how you were performing vs last year. Read more…

Tableau Server Parameter as a Month Filter

In a previous post about dashboard level filtering in Tableau I used an example of creating a month parameter to act as the filter. For this post to make sense please reference the previous post at the link.

The parameter worked perfectly in production, in the Tableau software, but when published on the server for some reason it didn’t work. It might have something to do with me being in the UK and the server I use in the US and the dates aren’t compatible, US being mm/dd/yy and the UK using dd/mm/yy – but I don’t know if this really is the problem or whether it could be that the parameter set up as a ‘Date and time’ appears to Tableau server as a text field because of the date formatting. In the example I format the date to display as the month name. (Custom format = mmmm gives a date format of January, February, March, etc.) Read more…