title: How to compare value of one variable with value of other variable in jolt
body: <p>I have 2 variables called &quot;score&quot; and &quot;scoreRange&quot; and assuming &quot;score&quot; value is 0.185 and I want to compare it with 0.3 and 0.9. my condition is as below.</p>
  <pre><code>if score is less than 0.3 (score &lt;0.3) -&gt; mark scoreRange as LOW,
  0.3 to 0.9  (0.3 &lt;= score &lt; 0.9) --&gt; mark scoreRange as MEDIUM
  and larger than 0.9 (score &gt;= 0.9) --&gt; mark scoreRaneg as HIGH
  </code></pre>
  <p>How to compare 0.185 with 0.3 or 0.9 in jolt.
  I tried creating an array with values [0.3, 0.9] and add the &quot;score&quot; to that array &quot;array&quot; : [ 0.3, 0.9, 0.185 ]. Then took out the min and max of that array. If Score is in min position or equal to min then scoreRange is low. If Score is in max position or equal to max then scoreRange is high. If both fails then medium. But currently i'm not getting how to compare with normal or array values.</p>
  <p>My Input ( Irrelevant )</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;sampleArray&quot;: [
      4,
      2,
      8
    ]
  }
  </code></pre>
  <p>Tried out spec</p>
  <pre class="lang-json prettyprint-override"><code>[
    {
      &quot;operation&quot;: &quot;default&quot;,
      &quot;spec&quot;: {
        &quot;array&quot;: [0.3, 0.9]
      }
    },
    {
      &quot;operation&quot;: &quot;modify-overwrite-beta&quot;,
      &quot;spec&quot;: {
        &quot;score&quot;: 0.185,
        &quot;array&quot;: {
          &quot;[2]&quot;: &quot;@(2,sumIntData)&quot;
        },
        &quot;minAB&quot;: &quot;=min(@(1,array))&quot;,
        &quot;maxAB&quot;: &quot;=max(@(1,array))&quot;
      }
    }
  ]
  </code></pre>
  <p>My current output.</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;sampleArray&quot; : [ 4, 2, 8 ],
    &quot;array&quot; : [ 0.3, 0.9, 0.185 ],
    &quot;score&quot; : 0.185,
    &quot;minAB&quot; : 0.185,
    &quot;maxAB&quot; : 0.8
  }
  </code></pre>
  <p>I'm new to jolt. Any guidance in comparing values will be helpful to me.
  And how to get a specific value from an array in jolt. elementAt option from jolt was not helpful</p>