title: Lag the date by considering data from another table
body: <p>have a question on whether the following can be done without having to do a for loop</p>
  
  <p>i have a ctry table that looks like the below</p>
  
  <pre><code> CTRY  LAG
    AU    2
    US    3
  </code></pre>
  
  <p>my data table looks like this</p>
  
  <pre><code> CTRY DATE         A     B    C
   AU   1960-01-31   0.3   0.4  0.5
   US   1960-03-31   0.3   0.4  0.5
   US   1960-04-30   0.35   0.42  0.54
  </code></pre>
  
  <p>What I would like to do is update the date column to month end date for each country by the given lag</p>
  
  <pre><code> CTRY DATE         A     B    C
   AU   1960-03-31   0.3   0.4  0.5
   US   1960-06-30   0.3   0.4  0.5
   US   1960-07-31   0.35   0.42  0.54
  </code></pre>
  
  <p>I am currently using a for loop but I am sure there is better and more efficient way to do this
  thanks so much</p>