Expand my Community achievements bar.

SOLVED

If statement not working

Avatar

Level 5

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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;
}

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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;
}

Perfect.  I knew it was something simple.

 

Thank you!!