Basic Mapping of SQL to Tableau

Deepak Holla
2 min readFeb 2, 2023

--

Ever wondered how Tableau generates the beautiful visualizations? It’s almost like magic right… The secret behind the magic of Tableau is a special type of SQL i.e. VizQL

This topic will be useful especially for Tableau newbies and Data Analysts early in their career to understand how Tableau works under the hood by doing all the heavy lifting in the background and how it provides a very easy drag and drop interface to the end user. In addition we need to understand that the foundation for any BI Tool (not only Tableau) is SQL as what we finally see as Vizzes is the data that is being pulled in via SQL like commands e.g: aggregated data using GROUP BY etc.

Actually all the work behind the scenes is taken care by VizQL which is the proprietary query language behind the Tableau product suite’s visual rendering. It essentially translates the SQL queries that traditionally return numbers and tables into an effortless visual analysis. As an end-user drags and drops data around the Tableau interface, each action generates a query that is subsequently translated into the VizQL language and finally rendered as the Tableau visuals.

Given below is an image that provides the basic mapping of SQL to Tableau

Basic SQL to Tableau Mapping

Given below are some points to be aware of:

NOTE 1: This example is only meant to give a basic mapping of SQL to Tableau and the example shown may not be a practical use case.

NOTE 2: The Pages shelf has not been utilized in the below Viz and has been included in the mapping just for reference

NOTE 3: There are other SQL clauses like JOINS, HAVING etc. that have not been included for this simple and basic SQL to Tableau mapping

REFERENCES:

https://www.tableau.com/drive/what-is-vizql

--

--

Deepak Holla

Recently made a transition into the field of Data Analytics. Have been featured in multiple Tableau DataFam Roundups..