LISE Compare a value
Posted: Thu May 25, 2023 8:34 am
I'm using LISE to store weight reports for projects, and need to compare the weight between 2 weight reports and show the difference in percentage.
I have the equation to use, but is stuck how i get the weight value from each report to calculate.
I always have 2 reports to compare/calculate, so i'm thinking i'll need to do something like this:
But is unsure if this is the best way to do it?
Any suggestions are greatly appreciated.
I have the equation to use, but is stuck how i get the weight value from each report to calculate.
Code: Select all
{math equation='((x-y)/y*100)' x=$weight1 y=$weight2 format='%.2f' assign='difference'}
Code: Select all
{if $smarty.foreach.foo.first}
{assign var="weight1" value=$item->fielddefs.weight.value}
{else}
{assign var="weight2" value=$item->fielddefs.weight.value}
{/if}
Any suggestions are greatly appreciated.