Expand my Community achievements bar.

SOLVED

Formula field interfering with 2nd formula field

Avatar

Level 5

My form has a field at the beginning where the user defines "full time" or "part time".  If "part time" is selected a "drop down %" field appears and the user defines the %.  This % is then used in a calculation in a table at the bottom of the field, calculating the "Total Pro-Rated Amount" field.  

 

If the "Total Pro-rated Amount" field is less than the "Remaining FY Tuition Allotment" field, the "Final Total Approved Reimbursement" field equals the "Total Pro-Rated Amount" field.  If the "Remaining FY Tuition Allotment" is less than the "Total Pro-rated Amount" field, then the "Final Total Approved Reimbursement" field equals the "Remaining FY Tuition Allotment" field. 

 

To complicate it even more, if the user chooses "full time" then the "Total Pro-Rated Amount" field will be null and at that time, the "Total" field right above it should be compared to the "Remaining FY Tuition Allotment" field and the lesser of these two fields should appear in the "Final Total Approved Reimbursement" field.

 

Through help of Experience League it has been determined the formula in the "Final Total Approved Reimbursement" field is correct and should work.  The thought now is that perhaps the issue lies in the "part time %" field that helps to populate the "Total Pro-Rated Amount".   I feel I'm missing something.  Please review.

 

Form

Completed examples

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 5

This did not work for me.  What we did do which does work is the following...

 

min(tblCourse.row9.proRatedApproved[*], row3.tuitionRemaining[0], tblCourse.row8.reimbApproved[0])

in form1.page1.bottom.tblReimbRcvd.row4.finalTotalApproved::calculate - (FormCalc, client)

 

 

View solution in original post

4 Replies

Avatar

Level 10

I can't find the find the fields you're mentioned since they are not named as described. Please highlight them in the sample form with a diffent color. 

Avatar

Level 10

Hi,

 

I guess a script as the following should to the trick.

var nPartTime = page1.subApplicant.ddPartTime.rawValue, //DDL
	nProRatedApproved = tblCourse.row9.proRatedApproved.isNull ? 0 : parseFloat(tblCourse.row9.proRatedApproved.rawValue), //green
	nReimbApproved = tblCourse.row8.reimbApproved.isNull ? 0 : parseFloat(tblCourse.row8.reimbApproved.rawValue), // red
	nCost2Dec = row3.cost2Dec.isNull ? 0 : parseInt(row3.cost2Dec.rawValue), //blue
	nResult = nCost2Dec; //yellow

if (nPartTime.isNull) {
	if (nProRatedApproved <= nCost2Dec) {
		nResult = nProRatedApproved
	}
} else {
	if (nReimbApproved <= nCost2Dec) {
		nResult = nReimbApproved
	}
}

this.rawValue = nResult;

 

Put it in the calculate event of form1.bottom.tblReimbRcvd.row4.cost2Dec.

Avatar

Correct answer by
Level 5

This did not work for me.  What we did do which does work is the following...

 

min(tblCourse.row9.proRatedApproved[*], row3.tuitionRemaining[0], tblCourse.row8.reimbApproved[0])

in form1.page1.bottom.tblReimbRcvd.row4.finalTotalApproved::calculate - (FormCalc, client)