title: Array calculation in Tableau, maxif routine
body: <p>I'm fairly new to Tableau, and I'm struggling in building some routines that could be easily implemented in Excel (though it would take forever for big sets of data).</p>
  
  <p>So here is the deal, consider a dataset with the following fields:</p>
  
  <p>int [id_order] -> id of the sales order (deepest level, there are only unique entries of id_order)
  int [id_client] -> as I want to know who bought it
  date [purchase_date] -> when the customer bought the product</p>
  
  <p>What I want to know is, for each order, when was the last time (if ever) the client has bought something. In order words, what is the highest purchase_date for that user that is smaller than current purchase_date.</p>
  
  <p>In excel, approach is simple (but again, not efficient)
  {=max(if(id_client=B1,if(purchase_order
  
  <p>Is there a way to do this kind of calculation in Tableau?</p>