I have been trying to calculate 4 fields into one field as listed below. Fields 1 through 4 are the ones that I'm trying to get the data from and the 5th field is where I'm trying to put the sum in. This seems difficult to do since the basic math calculation function only allows two fields per code. Can anyone help me with cleaning up the field to make this function work?
Here is the calculation that I tried using to put it together. I started extremely simple, but I think I overcomplicated it by troubleshooting blindly.
You can complete in three 'Basic Math Calculation' actions.
- 1) Field1+Field2 = ActionResult1
- 2) Field3+Field4 = ActionResult2
- 3) ActionResult1+ActionResult2 = ActionResultFinal
And lastly an Update Field On Screen: update 5th field with ActionResultFinal.
Give that a shot and see if it works for you.
Unfortunately, that did not work. With the fields marked 1,2,3,4, they are already a calculated field of the time difference in the two fields above each respectively. Does that make a difference for the adding of the fields?
It shouldn't be an issue, but it depends on the control flow.
For example, before Field 5 can be calculated Fields 1-4 cannot be empty and must have integers. Make sure Field 5 gets calculated at the end after all the other fields are finished being calculated.
Even try to add a button for testing purposes 'Field 5 Calculate' once the screen has Fields 1-4 with integers, click the button to execute Field 5 calculation.
Give that a shot and let me know how it works out.
With the integer issue, should I set the default value in the fields to 0 in fields 1 through 4?
Got it going! Thanks for the help with this!