title: Execute IF-THEN_ELSE before Execute Calculation - Tableau
body: <p>I have a graph below. </p>
  
  <p><a href="https://i.stack.imgur.com/Ewetp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ewetp.png" alt="enter image description here"></a></p>
  
  <p>I would like to calculate lapsed rate which is sum of lapsed value divided by sum of inforce value. I use the formula below in calculated field. </p>
  
  <pre><code>abs(sum(if[Status]='lapsed'then[TotalAmount]end))/abs(sum(if[Status]='inforce'then[TotalAmount]end))
  </code></pre>
  
  <p>However that formula will also pick the value from Q2 (quarter 2) 2016. What I want to do is to tell tableau to check first if any quarter does not contain both inforce value and lapsed value then skip that quarter. In this case I need to calculate lapsed rate which does not include Q2 2016. How do i do this?</p>
  
  <p>I'm using Tableau v.10. </p>
  
  <p>Thanks. </p>