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
  • I have one  query related to the richtextdisplayfield.Could you please suggest? 

     a!richTextDisplayField(
                  value: if(
                    fv!item.finCov_txt = "Other",
                    tointeger(fv!item.actualThreshold_txt) - tointeger(fv!item.covenentThreshold_txt),
                    if(
                      rule!CR_APP_DSC_displayFinCovPlaceholder(
                        finCovType_txt: displayvalue(
                          fv!item.finCov_txt,
                          ri!crRefFinCov_cdt.finCov_txt,
                          ri!crRefFinCov_cdt.valueType_txt,
                          ""
                        )
                      ) = "m:n",
                      rule!CR_APP_FinCovCalculationmn(
                        valueType1_txt: fv!item.actualThreshold_txt,
                        valueType2_txt: fv!item.covenentThreshold_txt
                      ),
                      if(
                        rule!CR_APP_DSC_displayFinCovPlaceholder(
                          finCovType_txt: displayvalue(
                            fv!item.finCov_txt,
                            ri!crRefFinCov_cdt.finCov_txt,
                            ri!crRefFinCov_cdt.valueType_txt,
                            ""
                          )
                        ) = "m:1",
                        rule!CR_APP_FinCovCalculationm1(
                          valueType1_txt: fv!item.actualThreshold_txt,
                          valueType2_txt: fv!item.covenentThreshold_txt
                        ),
                        if(
                          rule!CR_APP_DSC_displayFinCovPlaceholder(
                            finCovType_txt: displayvalue(
                              fv!item.finCov_txt,
                              ri!crRefFinCov_cdt.finCov_txt,
                              ri!crRefFinCov_cdt.valueType_txt,
                              ""
                            )
                          ) = "Amount",
                          (
                            fv!item.actualThreshold_txt - fv!item.covenentThreshold_txt
                          ) / fv!item.actualThreshold_txt * 100,
                          if(
                            rule!CR_APP_DSC_displayFinCovPlaceholder(
                              finCovType_txt: displayvalue(
                                fv!item.finCov_txt,
                                ri!crRefFinCov_cdt.finCov_txt,
                                ri!crRefFinCov_cdt.valueType_txt,
                                ""
                              )
                            ) = "Percentage",
                            (
                              (fv!item.actualThreshold_txt / 100) - (fv!item.covenentThreshold_txt / 100)
                            ) / (fv!item.actualThreshold_txt / 100) * 100,
                            null
                          )
                        )
                      )
                    )
                  ),
                  style: if(
                    fv!item.varience_txt > 0,
                    "color: green;",
                    if(
                      fv!item.varience_txt < 0,
                      "color: red;",
                      {}
                    )
                  )
                ),

    I have used richTextDisplayfield to write some colour logic.Since I would need green colour if the varience returns positive otherwise red .Since in 22.4.660.0 version doesn't have style parameter in richtextdisplayfield, How could I achieve this?

Children