Home > Tableau, Tableau Server > Tableau Server Parameter as a Month Filter

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.)

After spending a few hours trying to work out why the parameter doesn’t work on the server yet works in production I gave up trying to get the answer and instead looked for a way to make it work.

When the parameter was first created it was a ‘Date and time’ parameter populated by a Date data type field called [StartOfMonth]. For the parameter to work on the server the data type needs to be ‘String’. This means the field populating the parameter also needs to be string.

Create a very simple calculated field just selecting the month name of your Date field using the DATENAME function: DATENAME(‘month’,[StartOfMonth] ). Use this field to populate the list in the parameter instead of the original Date field.

Next alter the filter field slightly to make sure it filters on the actual month name. The filter calculated field, in this example, is simply: DATENAME(‘month’ ,[StartOfMonth]) = [MonthParameter].

If you re-publish the dashboard on to the server with this newly edited parameter it will now filter all of the sheets in the dashboard.