pbPassingBI
/

Connecting to files and databases

The data source page, connection types, and what to do before building anything.

What you'll be able to do
  • Connect to files and databases
  • Prepare fields on the data source page
  • Decide what belongs upstream

Connection types

The connect pane splits into To a File — Excel, text, JSON, PDF, spatial, statistical — and To a Server, covering the databases and cloud services.

Each database has a native connector, which is faster and more capable than a generic ODBC connection. Use the native one where it exists.

You can also connect to a published data source already on Server, which is usually the right answer in an established team — someone has already modelled and governed it.

The data source page

Everything you do here applies wherever the data source is used, which makes it the cheapest place to fix things:

  • Rename fields to what a business user would call them
  • Hide fields nobody will need
  • Set data types and geographic roles
  • Create calculated fields shared by every workbook
  • Set default formatting — currency, decimal places
Hide unused fields before extracting

This is the cheapest performance improvement available in Tableau, and the data source page is where you do it.

Custom SQL

The connection pane allows custom SQL. It works, and it is usually the wrong tool.

Tableau wraps your query as a subquery, so it cannot optimise through it — filters and aggregations that would normally be pushed to the database are applied afterwards. On a large table that difference is dramatic.

Where logic is genuinely needed, a view in the database performs far better and can be reused.

Where preparation belongs

WorkBelongs
Joins, renames, hidden fieldsData source page
Repeatable multi-step cleaningTableau Prep or the warehouse
Business logic used by several teamsThe warehouse
View-specific calculationsThe workbook

The general rule: the further upstream a transformation happens, the more places benefit from it.

Key points
  • The data source page applies changes everywhere the source is used
  • Custom SQL blocks optimisation — prefer a database view
  • Hiding unused fields before extracting is the cheapest speed win
Check yourself