KNOWLEDGE BASE

Using 'OR' in Join Clause in Tableau Prep


Published: 13 Dec 2019
Last Modified Date: 15 Jan 2020

Question

How to use 'OR' in the join clause. For example: select * from Sheet1 join Sheet2 on Sheet1.A=Sheet2.A OR Sheet1.B=Sheet2,B 

Environment

Tableau Prep

Answer

  1. Connect to Sheet1 and to Sheet2
  2. Join Sheet1 & Sheet2 by dragging Sheet 2 as a Join to Sheet 1. 
    • The inner join should show: Sheet1.A=Sheet2.A 
  3. Join Sheet1 & Sheet2 by by dragging Sheet 1 as a Join to Sheet 2. 
    • The inner join should show:  Sheet1.B=Sheet2.B 
  4. To remove duplicated records, filter Join 2 by the calculation: NOT [A]=[A-1]
  5. Union Join 1 & Join 2 by dragging Join 2 to Join 1 as a Union.

Additional Information

To view the above steps in action, see the video below.
Note: the video has no sound. To view the video in higher quality, click the YouTube icon below to watch it on YouTube directly.
Did this article resolve the issue?