Problem Statement and Target Companies who can use this:

Active Oldest Votes. Tableau Public does not support connecting to SQL databases. Take a look at this link to see what is supported: Microsoft Excel 2007 or later. Microsoft Windows Azure Marketplace DataMarket. Tableau Server enables everyone in an organisation to see and understand data, with offerings for every user type. Starting with casual users looking to make data-driven decisions from a published dashboard, data enthusiasts who want to use web authoring to ask new questions from published data source, to data geeks who want to create and share. Jul 18, 2017 With Tableau Desktop UI there is a single SQL Server connector for Azure SQL DB, Azure SQL Data Warehouse, or SQL Server 2016, running on premises or in a public cloud like Azure. Tableau Live Querying provides the best performance.

You have made a dashboard for your client using Tableau.

Tableau Public Sql Server 2019

Your company is very small, having very limited budget for IT and a few clients only at this stage. You are looking to share Tableau reports with clients using Tableau public link.

Client looking for username and password for the link to access the reports.

Research:

1. By doing research and taking advice from contacts with experience in Tableau server, I realised that publishing reports on Tableau server makes the reports secure however it is not optimum solution for companies which have very limited budget as it comes with a huge cost.

2. Posting on Tableau public account, restricting visibility through Toggle button and sharing the link to clients to access the report is a workable solution but not preferred method as the link can be mistakenly shared to users not allowed to see the analysis.

Sql

Solution?

1. Creating a new account on Tableau public (https://public.tableau.com) with client details. Usually we publish reports on our Tableau public account, secure reports and share link to make it unrestricted access but here we have to create a new account for the end user.

2. Publishing the reports and making it invisible using the toggle button.

3. Sharing the link to with username & password for the client to access the report.

Explanation:

1. Anyone having the access to the link will have to provide username and password to access the report.

Tableau

Sql Server Download Free

2. Also if someone is randomly searching for reports on Tableau public or Google etc with keywords related to the dashboard, they would be able to see the clients profile only but reports will still not be visible as they will have to login to the profile with the username and password to access the report.

Important Note: This does not signify that I am saying not to buy license for server, however this is a workable solution to start sharing reports with clients and providing security to the access of reports.

Connection

SQL Server (among other databases) has a handy feature for easy re-use of queries, in the guise of variables. You can declare variables and use them repeatedly in any query in the current session. That’s pretty handy for any complicated query forms you use repeatedly, where each time you might need to change some basic criteria.

As a trivial example: here’s how to select all the customers I have that live in postcode 12345

Tableau Sql Server

DECLARE @postcode varchar(5)
SET @postcode = '12345'

SELECT POSTAL_CODE, CUSTOMER_NO FROM [MY_CUSTOMERS] WHERE POSTAL_CODE = @postcode

I can then run it another day for postcode 23456 by just changing the second line to

SET @postcode = '23456'

This example is a bit silly because you might as well just type 12345 or 23456 into the query itself – but imagine a more complex SQL statement, or set of coordinated SQL statements, with screenfuls of code, and you might see how it makes it much easier to maintain.

But, sad to say, you can’t use these sort of variables as part of the custom SQL feature in Tableau. If you try, then you’ll get this slightly unhelpful message:

[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'DECLARE'.
[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ')'.

But rather than have to hardcode your queries and modify them for every extract you can use a very simple alternative: our friend, the Tableau parameter.

Tableau Sql Server Windows Authentication

For each SQL variable, create a Tableau parameter of the same data type. You can put in a default value as the “Current value” when setting it up.

Tableau Sql Server Driver

Then, when connecting to your database, paste in the original SQL statement you had into the Custom SQL box, but removing the variable declaration and setting from the top.
SELECT POSTAL_CODE, CUSTOMER_NO FROM [MY_CUSTOMERS] WHERE POSTAL_CODE = @postcode

One at a time, highlight each SQL variable there, i.e. the @postcode part of the above, press the “Insert Parameter” button under the text field and select the appropriate Tableau parameter.

(There is actually the option to create a new parameter at this stage, if you didn’t do so in advance).

You’ll end up with a similar looking SQL statement, but with the variables now referred to in this sort of way:

SELECT POSTAL_CODE, CUSTOMER_NO FROM [MY_CUSTOMERS]
WHERE POSTAL_CODE = <Parameters.Postcode>

And it’ll work!

You can then use the standard Tableau functionality to change the parameters in Tableau, and behind the scenes your SQL statement will update appropriately.

Note firstly, for performance, that each change of this sort of parameter is going to cause the query to be re-run on the database (unless it’s already been cached).

Secondly, if you have created a Tableau Data Extract from this datasource, then altering the parameter won’t change anything until you refresh the extract.

Finally, the Tableau parameter is simply a normal Tableau parameter, just like anything else. So there’s nothing to stop a Tableau user altering it, which depending on your setup might be either exactly what you want, or exactly what you don’t want. If the latter, you might consider having the datasource involving parameters in a separate workbook to the user-facing dashboard (publishing to Tableau Server to share), or at least making sure it’s not visible on the end-user dashboards if they have no reason to change it.

Quick sidenote: I wondered if the “Initial SQL” feature might work, to declare variables upon connection to the datasource which could then be used in custom SQL later. But sadly not, I guess it doesn’t count as the same session. If you try, you’ll see a message like:
[Microsoft][SQL Server Native Client 11.0][SQL Server]Must declare the scalar variable '@postcode'

Coments are closed

Most Viewed Posts

  • Burn Spray
  • The Mentalist Amazon Prime
  • Tableau Public Sql

Scroll to top