I am trying to translate the following SQL query into Tableau:
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)
I am quite new to Tableau and can't figure out how to translate the where clause as it is selecting from another table.
For example, given the following tables
Store 1:
Name | City | Order Date 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
Store 2:
Name | City | Order Date 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
My query would return the following from Store 1:
Name | City | Order Date Bob | Boston | 31-Jan-17 Cathy | Boston | 31-Jan-17