RE: Difference of two ratio numbers

Hi ,

I need some calculation logic in appain that gives difference of ration numbers example shown below in the screenshot.

Can someone help me to write the logic for this on priority?

Here actual and threshold values are user inputs based on those inputs variance col data to be shown .

  Discussion posts and replies are publicly visible

Parents Reply
  • a!localVariables(
      local!ratio1: "3:4",
      local!ratio2: "5:6",
      local!ratio1Array: split(local!ratio1, ":"),
      local!ratio2Array: split(local!ratio2, ":"),
      local!lcm: lcm(
        local!ratio1Array[2],
        local!ratio2Array[2]
      ),
      local!numerator: (
        local!ratio1Array[1] * (local!lcm / local!ratio1Array[2])
      ) - (
        local!ratio2Array[1] * (local!lcm / local!ratio2Array[2])
      ),
      if(
        mod(local!numerator, local!lcm) = 0,
        local!numerator / local!lcm,
        concat(local!numerator, "/", local!lcm)
      )
    )

    Ok this code is giving difference of two numbers which is in ratios ,How to get the result by doing this calculation like the scenario difference of those numbers i.e (-1/12) and divided by local!ratio1 i.e 3:4 and multiply with 100.

    So formula would be like this(local!ratio1(3:4)-local!ratio2(5:6)/local!ratio1(3:4)*100

    I hole this makes more clear

Children