If statement not working | Community
Skip to main content
ReluctantProgrammer
Level 4
July 20, 2023
Solved

If statement not working

  • July 20, 2023
  • 1 reply
  • 692 views

I have the following located in the field's Calculate script but cannot get it to work.  It seems pretty basic but I am missing what's wrong.


if (tblReimbRcvd.row3.cost2Dec.rawValue > tblCourse.row8.cost2Dec.rawValue)
{
this.rawValue = tblCourse.row8.cost2Dec.rawValue;
} else {
this.rawValue = tblReimbRcvd.row3.cost2Dec.rawValue;
}

 

 

 

File can be found here.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Vijay_Katoch

Try this:

 

if (Number(tblReimbRcvd.row3.cost2Dec.rawValue) > Number(tblCourse.row8.cost2Dec.rawValue))
{
this.rawValue = tblCourse.row8.cost2Dec.rawValue;
} else {
this.rawValue = tblReimbRcvd.row3.cost2Dec.rawValue;
}

1 reply

Vijay_Katoch
Community Advisor
Vijay_KatochCommunity AdvisorAccepted solution
Community Advisor
July 21, 2023

Try this:

 

if (Number(tblReimbRcvd.row3.cost2Dec.rawValue) > Number(tblCourse.row8.cost2Dec.rawValue))
{
this.rawValue = tblCourse.row8.cost2Dec.rawValue;
} else {
this.rawValue = tblReimbRcvd.row3.cost2Dec.rawValue;
}

ReluctantProgrammer
Level 4
July 21, 2023

Perfect.  I knew it was something simple.

 

Thank you!!