1 Reply Latest reply on Mar 15, 2018 9:12 AM by Alyssa Ashton

    Union multiple queries, not datasources

    Alyssa Ashton

      Hello,

      I am trying to figure out how to use UNION in tableau.  I see on the datasource, you can use New Union to combine multiple datasources.  This just opens a window where you can drag the additional tables.   But my query contains multiple queries of the same tables, unioned together.  Each separate query has different filters on it.  Do I have to create the same datasource twice?  How do I union the results of multiple different queries??

      As an example in a very basic from:

       

      SELECT *

      FROM Employees

      INNER JOIN Providers

      ON Employees.Employee_ID = Providers.Employee_ID AND Providers.Type = 'MD'

      WHERE Employees.Last_Name = 'Smith'

       

      UNION

       

      SELECT *

      FROM Employees

      INNER JOIN Providers

      ON Employees.Employee_ID = Providers.Employee_ID AND Providers.Type = 'RN'

      WHERE Employees.City = 'Dallas'