Avatar

Level 1

Thank you so much for your reply.  You are putting me on the right track.

However, in my original code I have two if statements, one to sum the First row and one to sum the Others row.  Would you mind incorporating that in your explanation?  I am having trouble picturing how that looks.

I appreciate your time.

Michael

form1.GoalSheet.PracticeTitle1::calculate - (JavaScript, client)

var len = form1.GoalSheet.Table6._Others.count;

var sum = 0.0;

if (form1.GoalSheet.Table6.First.Funding1.rawValue==1)

          {

          sum += form1.GoalSheet.Table6.First.Cost.rawValue;

          }

for (var i = 0; i < len; i++){

if (form1.GoalSheet.Table6.resolveNode("Others[" + i + "]").fsource.rawValue==1) {

                              sum += form1.GoalSheet.Table6.resolveNode("Others[" + i + "]").Cost2.rawValue;

                    }

          }

this.rawValue = sum;