title: nested if loop in splunk
body: <p>I would like to write in splunk a nested if loop:
  <strong>What I want to achieve</strong></p>
  <blockquote>
  <pre><code>if buyer_from_France: 
     do eval percentage_fruits
     if percentage_fruits&gt; 10:
          do summation
          if summation&gt;20:
                     total_price
                     if total_price&gt;$50:
                                do(trigger bonus coupon)
  </code></pre>
  </blockquote>
  <p>My current code (that works):</p>
  <pre><code>&gt; | eventstats sum(buyers_fruits) AS total_buyers_fruits by location
  &gt; | stats sum(fruits) as buyers_fruits by location buyers 
  &gt; | eval percentage_fruits=fruits_bought/fruits_sold 
  &gt; | table fruits_bought fruits_sold buyers
  &gt; | where percentage_fruits &gt; 10
  &gt; | sort - percentage_fruits
  </code></pre>
  <p>How do I complete the syntax/expression for the 2nd (summation) and consequently, 3rd (total price), 4th if-loop (trigger)?</p>