Expand my Community achievements bar.

Auto check calculating the Average

Avatar

Level 7

I do not know how to approach an issue with my form, so any help or quide will be appreciate very much!

For a Performance Form I have 5 sections for the managers to fill in.

Every section includes an Assessment drop down list with 5 items to select from.

Items for DDList (Named:Assessment):

Outstanding

Exceeds Expectations

Meets Expectations

Needs Improvement

Does Not Meet Expectations

Final at the end of the form I have a section named

OVERALL SUMMARY OF PERFORMANCE with 5 check boxes named:

Outstanding

Exceeds Expectations

Meets Expectations

Needs Improvement

Does Not Meet Expectations

Is it possible with a script(Calculating the average?), AUTO to check(one of the check boxes for the Overall sum of performance?

THANK YOU

26 Replies

Avatar

Former Community Member

Not sure I follow ....if the Manager picks a unique option for the 5 sections then what am I supposed to set on the Final? You could tally up the number of times the option was chosen and indicate that to the Manager but having the script check something automatically is doable as long as you have a set of rules to follow when there are ties.

Maybe I am misunderstanding your requirement.

Please elaborate.

Paul

Avatar

Level 7

I am sorry if I am missunderstoond...

Managers have to pick one of the five items below for every section, I do not understand what you mean unique option   :

Outstanding

Exceeds Expectations

Meets Expectations

Needs Improvement

Does Not Meet Expectations

Total we will have 5 Assessments, one for each section.

What about if items have an export value as:

Outstanding                            5

Exceeds Expectations               4

Meets Expectations                  3

Needs Improvement                2

Does Not Meet Expectations    1

For the Sum above divide by 5=Overall Performance.

For example If Overall Performance equal or larger than 3.5 the resualt is Exceeds Expectations

For example If Overall Performance is smaller than 3.5 the resualt is Needs Improvement

and so on....

Avatar

Former Community Member

Now that is doable .....I will mock up an example this afternoon and post it back here

Paul

Avatar

Former Community Member

Here is a quick sample I put together. The Total at the top is the running total of the scores that were awarded for each Question. That field woudl be hidden when you are finished. I left it visible to make it easier to see what was happening.

Paul

Avatar

Level 7

Thanks Paul for you sample works great for my form!

I have apply your idea and script with some modifications for our needs. Thanks again.

There is One more thing to apply...

One of the sections for some employees is applicable and for some NOT.

For the Total marks I use the script:

Total.rawValue

=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue+AssesE.rawValue)/5;

If section 5 for the employee it is not applicable(NO VALUE) my script should be:

Total.rawValue

=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue)/4;

How I can accomplish this one?

May I send you my form to have abetter idea what I mean?

Thanks Paul

Avatar

Former Community Member

You can simply do a test to see if NoValue is selected ..if it is then you execute one formula (the divide by 4)  if it is not then you execute the other formula (the divide by 5). Make sense?

Paul

Avatar

Level 7

Hi Paul, below is the script I am using for the Total Score but does not work!

AssesE is the section which does not apply(It is not applicable, so there is no value).

What I am doing wrong?

Thank you

form1.#subform[0].Total::calculate - (JavaScript, client)

if (AssesE.rawValue="")
{
Total.rawValue=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue)/4;
}
else
{

Total.rawValue=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue+AssesE.rawValue)/5;
}

Avatar

Former Community Member

The logic of the script looks OK ...is there a space between the AssesD. and the rawValue? You can use the syntax checker in Designer to validate that your script syntax is OK (the book with the green checkmark on it next to the event selection). Once that check is done, you can lok at the Javascript console (only available through Acrobat) to see if your script is generating any errors (just hit Cntrl-J when the form is running - even in preview).

Paul

Avatar

Level 10

Also, in the if statement you need a double "==" when testing equality.

Niall

Avatar

Level 7

Hi Paul I am not getting any error and there is

not any space.

Hi Niall, here is my script with your suggestion but does not work.

form1.#subform[0].Total::calculate - (JavaScript, client)

if

(AssesE.rawValue=="")

{

Total.rawValue

=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue)/4;

}

else

{

Total.rawValue

=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue+AssesE.rawValue)/5;

}

Thank you all

Avatar

Former Community Member

Then I will have to see it in action ...can you send me the form?

Paul

Avatar

Level 10

What is AssesE? Is it a checkbox? If it is then it won't have a rawValue of "", it will either be "1" or "0". If AssessE is a numeric field or text field, try testing against null instead of "".

Niall

Avatar

Level 7

Hi Paul, where I can send it?

Thanks

Avatar

Level 7

Hi Niall,

AssesA, AssesB, AssesC, AssesE, AssesD are Drop Down Lists

with 5 Items and export values 1, 2 ,3 ,4, 5.

Thanks

Avatar

Level 10

Yes, I would test against null.

Also maybe consider having a sixth option which has a blank display value. That way if the user selects an option from the dropdown and then changes their mind, they can select the blank, effectively clearing the dropdown. If you do this, you would need to test against null and the bound value of the blank.

Something like:

if (AssessE.rawValue == null || AssessE.rawValue == "6")

{

     // don't include E in the calculation

}

else

{

     // do include E in the calculation

}

Good luck,

Niall

Avatar

Level 7

Hi Niall, here is my script after your

suggestions:

form1.#subform[0].Total::calculate - (JavaScript, client)

if

(AssesE.rawValue == null || AssesE.rawValue == "6")

{

Total.rawValue

=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue)/4;

}

else

{

Total.rawValue

=(AssesA.rawValue+AssesB.rawValue+AssesC.rawValue+AssesD.rawValue+AssesE.rawValue)/5;

}

Still does not work....

For example if I select items A(Export value 5 each) for all DDL (5+5+5+5+5)/5 gives me 11.111!

The correct culculation is (5+5+5+5+5)/5=5

Thank again

Avatar

Level 10

Hi,

I think the issue is that the calculation script does not recognise the dropdown.rawValue as a number.

In this example: https://acrobat.com/#d=wRD6IJRHL5VGUCmv8AtFpw I have included the Number() to set the data type of the dropdowns.

Hope that helps,

Niall

Avatar

Level 7

That was the solution: Number() !!!!

THANK YOU Niall, THANK YOU Paul for all your help in this matter!

THANK YOU!

Avatar

Level 7

Hi Niall,here again with the same project but with a different aspect.

Is it possible for your example(Score from dropDown) to add 5 NumericFields as below to calculate separate the score for Outstanding,

the score for Exceeds Expectations and so on.....:

OUTSTANDING SCORE,

EXCEEDS EXPECTATIONS SCORE

MEETS EXPECTATIONS SCORE

NEEDS IMPROVEMENTSCORE

DOES NOT MEET EXPECTATIONS SCORE

Thank you Niall

Avatar

Level 10

Hi,

As you have described it, I would be inclined to have a numeric field associated with each dropdown and then give each field the same name as the dropdown and set the binding to 'global' (see Object > Binding palette).

Here is an updated sample: https://acrobat.com/#d=wRD6IJRHL5VGUCmv8AtFpw

This works because the dropdowns have specified values (now 5 to 0). While the dropdown will display the 'display value', the numeric field will show the dropdown's rawValue (eg a number).

Hope that helps,

Niall