These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Arithmetic Problems...

Holirang
Registered: Apr 13 2010
Posts: 6

I've created a multi-page weighted value self-audit form that uses radio buttons with export values 4, 3, 2, 1, 0, and NA. The calculation to sum the respective export values works correctly, and the resultant totals populate the scorecard on the Total side of the last page of the self-audit.

There are four columns in the scorecard: Total Possible, Total Raw, Total NA, and Total. My problem has two parts. First, I need a calculation script to subtract the Total NA from the Total Possible value, and then divide Total Raw by the subtraction result times 100, which should give me a percentage value in the Total field.

The second part is to take the Total field value, and based on the value of that number, place it in the respective field in the weighted portion of scorecard. For example, if the Total field percentage is greater than or equal to 1 and less or equal to 25, the Total field number will populate that field, or the 26 - 50 field, or the 51 - 75 field, or the 76 - 100 field, then that number will be multiply by the weight for that particular line.

Any help would be greatly appreciated.

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Have you looked at the 'Scripting Reference' provided in LiveCycle Designer, look under the menu bar 'Hep' option. There is a 'Count' function in FormCalc.

Description:
Evaluates a set of values and/or expressions and returns the count of non-null elements contained within the given set.

So this should provide the ability to count for the 'N/A' option. Since you have designed the form you should know the total number of questions. You then need to use the subtraction operator in FormCalc.

The Scripting Reference also describes the 'if then else endif' statement.

George Kaiser

Holirang
Registered: Apr 13 2010
Posts: 6
Thanks for the reply.

I've placed the following in the "Calculate" event and I get nothing in the respective fields. Seeing that I can't insert the actual script, I'll describe it the best I can.

I've created two variables, One and Two for simplicity's sake. Variable One is the sum of the total possible points minus the total NA points, times 100.

Variable Two is the sum of Variable One divided by the total raw value.

Next, if Two is greater than or equal to 1 and Two is less than or equal to 25, this raw Value = Two.
So forth and so on.

I get no values in any of the fields based on the script. Is there a way to test the Variables to make sure values are correct?