Skip navigation

Built-in 2-step SQL engine

score 14
You have not voted. Active

What

Add a Tableau SQL engine that allows a data set to be built in 2 (or more) steps.

 

I know I ask for much, but my intent is not a full-blown SQL engine — although it might be if something like PostgreSQL

is doing the background work — but rather support of basic SQL techniques that allow us in a simple way to

(1) reshape data and or (2) add dimensions from external sources.

 

Example

Here is a simplified example with an external date dimension in step 2 that is used to reshape data:

 

Step 1: Custom SQL from Microsoft SQL Server

SELECT Event_ID, Start_Time, End_Time

FROM Events

 

Step 2: Custom SQL between result set of step 1 and a (small) date dimension in a text file

SELECT d.Date e.Event_ID

FROM [Step 1] e, [Alias of external source]* d

WHERE d.Date BETWEEN Start_Time AND End_Time

* [Alias of external source] can be any external source supported by Tableau. Multiple tables from various sources should be allowed.

 

See example of above query in attached workbook in The specified item was not found..

 

Uses

  • Reshaping Data
  • Adding External Dimensions
  • Data Masking  read more

Comments

Vote history