title: Translating SQL query to Tableau
body: <p>I am trying to translate the following SQL query into Tableau:</p>
  
  <pre><code>select store1.name, store1.city, store1.order_date
  from store1
  where order_date = (select max(store2.order_date) from store2 
                      where store2.name = store1.name
                      and store2.city = store1.city)
  </code></pre>
  
  <p>I am quite new to Tableau and can't figure out how to translate the where clause as it is selecting from another table.</p>
  
  <p>For example, given the following tables</p>
  
  <p>Store 1: </p>
  
  <pre><b>Name</b>   | <b>City</b>      | <b>Order Date</b>
  Andrew | Boston    | 23-Aug-16
  Bob    | Boston    | 31-Jan-17
  Cathy  | Boston    | 31-Jan-17
  Cathy  | San Diego | 19-Jan-17
  Dan    | New York  | 3-Dec-16</pre>
  
  <p>Store 2:</p>
  
  <pre><b>Name</b>   | <b>City</b>      | <b>Order Date</b>
  Andrew | Boston    | 2-Sep-16
  Brandy | Miami     | 4-Feb-17
  Cathy  | Boston    | 31-Jan-17
  Cathy  | Boston    | 2-Mar-16
  Dan    | New York  | 2-Jul-16</pre>
  
  <p>My query would return the following from Store 1:</p>
  
  <pre><b>Name</b>   | <b>City</b>      | <b>Order Date</b>
  Bob    | Boston    | 31-Jan-17
  Cathy  | Boston    | 31-Jan-17</pre>