Clarity

  • 1.  Number comparison in GEL

    Posted May 02, 2017 12:58 PM

    Has anyone done Number comparison in GEL script without using SQL? How is that done if used, please put example.



  • 2.  Re: Number comparison in GEL

    Posted May 03, 2017 02:57 AM

    Hi,

     

    I have used a basic example where i have created a number varibale then incremented that followed by a comparision.

     

    <!-- Number declaration -->
    <core:set value="${0}" var="num_val1"/>
    <core:set value="${5}" var="num_val2"/>
    <gel:log>Number Variable1 is ${num_val1}</gel:log>
    <gel:log>Number Variable2 is ${num_val2}</gel:log>

    <!-- Number variale modification -->
    <core:set value="${num_val1+3}" var="num_val1"/>
    <gel:log>Number after adding 3 to varibale1 value is ${num_val1}</gel:log>

    <!-- Number compasrison -->
    <core:if test="${num_val1 > 2}">
    <gel:log>Number ${num_val1} is greater than two</gel:log>
    </core:if>

    <!-- Number compasrison -->
    <core:if test="${num_val2 > num_val1}">
    <gel:log>Number varible2 value: ${num_val2} is greater than variable number value: ${num_val1}</gel:log>
    </core:if>

     

    Let me know if this helps.

     

    Regards,

    Prashank Singh



  • 3.  Re: Number comparison in GEL

    Posted May 04, 2017 04:35 PM

    Thanks for example, it is helpful, will need to try this out.