3 Replies Latest reply on Sep 30, 2017 6:30 PM by Hari Ankem

    Creating a Custom SQl to union two tables with different column counts

    Raoul Leblanc

      I am using Tableau 10.3 Desktop.  We are evaluating various cloud options for our dataset and are testing Snowflake.  I need to make a union of two files.  Usually, this is very easy by using the New Union feature.  Unfortunately, it does not work in Snowflake.

       

      So I have to us their “Custom SQL” method, which I have used in the past without much problem.    Normally, I
      union tables by using the following:

       

      Select *

      From Table1

      Union

      Select *

      From Table 2

       

      However, in this case, the first table has 5 columns.  The second table has the same five columns, but also 9 more, for a total of 14.  So Tableau returned an error. 

      It seems like I need the Custom SQL to select only the common
      columns. 

       

      Knowing nothing about SQL, I looked on the Tableau site and
      tried a few things.   But I keep getting the following error (see attached).
      I feel as though this is an easy fix and I simply do not know the right syntax.  But if anyone can help, I would appreciate it.