Avatar

Level 2

Hi,

I'm using Livecycle Designer for a dynamic form.  I have a section of a form that contains fields for the user to enter goals in one column and then choose a rate (0,1,2,3,NA) for that goal in another column.  There is a formula to add up the number of goals entered if the field has text in it.  There is a situation where the user will enter a goal but the chosen rate will be NA - meaning that there is a goal but its not applicable at this time.

If I have 3 goals entered, and one is rated NA with the others rated at 1 (goal one = 1 point, goal two = 1 point, goal three = NA), there will be three goals and only 2 points.  I need to have the goal listed but it can't be added into the total of goals field.

Goal 1 = 1 point

Goal 2 = 1 point

Goal 3 = NA

Total points = 2 with three goals would then be divided for an overall score.  Total points (2) divided by 3 goals = 0.67.  Problem is that the goal with a rate of NA can't be counted into the formula.  It should calculate as Total points (2) divided by 2 goals = 1.0.  The NA will not have a numeric value.

Current formula for adding goals is:

var

goalcount = 0

if

(Table3.Row1.currentgoal1.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row2.currentgoal2.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row3.currentgoal3.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row4.currentgoal4.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row5.currentgoal5.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row6.currentgoal6.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row7.currentgoal7.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row8.currentgoal8.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row9.currentgoal9.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row10.currentgoal10.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row11.currentgoal11.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row12.currentgoal12.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row13.currentgoal13.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row14.currentgoal14.rawValue

!= null){

goalcount

= goalcount + 1;

}

if

(Table3.Row15.currentgoal15.rawValue

!= null){

goalcount

= goalcount + 1;

}

this.rawValue

= goalcount;