Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7151 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a script that is designed to report a student's performance qualitatively using the student's average, the average of the class, and the population standard deviation of all of the students' grades. This is all acomplished through a series of If / Else If statements. All of the statements, with the exception of 1, work perfectly and I can not figure out why the 1 step won't evaluate as true. I have attached a pdf of the script.

Field Definitions:

Performance is a plain text field.

TotalAvg is a calculated number field that gives the student's total average.

ClassAvg is a calculated number field that takes the average of students's total averages self-joined table. Average ( MFE Avg::TotalAvg )

TotalAvgStDevP is a calculated number field that takes the population standard deviation using the same self-join table as ClassAvg. StDevP ( MFE Avg::TotalAvg )

The "Average" case is what is causing me trouble. Nothing evaluates to "Average", they simply get assigned the default "NGR".

Any help that anyone can provide me would be greatly appreciated.

Script.pdf

Posted

Maybe someone else has sharper eyes, but I don't see anything obviously wrong with the script. If the problem isn't with the script, it's got to be in the data the script is working with.

Are you certain that there really are records that meet the criteria for average? An easy test would be to create a calculated field that evaluates to true or false for that one condition condition and see what it shows for each record.

One suggestion: instead of using a series of script steps, you might want to rewrite this as a single calculation using the CASE function. It might be easier to read that way.

Posted

I have checked and there certainly are records that fulfill those criteria, 78 out of 408 records should be evaluated as "Average".

The Performance field used to be a calculated field, but since the ClassAvg and TotalAvgStDevP fields were unstored calculation fields (since the referenced seperate tables) it would take me almost a full minute to load each record. Thus, my solution of putting it all in script that will just get run once a week.

Posted

It is difficult to see what's going on from the script alone, so let me suggest a way to troubleshoot this.

First, restore the calculated field and see if this is giving you the correct result. The calculation, I presume, will be something like:

Case ( 

Status <> "Enrolled" ; 

Status ; 



TotalAvg > ( 1.54 * TotalAvgStDevP + ClassAvg ) ; 

"Outstanding" ; 



( 1.54 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > ( 1.1 * TotalAvgStDevP + ClassAvg ) ; 

"Good" ; 



( 1.1 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > ( .66 * TotalAvgStDevP + ClassAvg ) ; 

"Decent" ; 



( .66 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > ( .22 * TotalAvgStDevP + ClassAvg ) ; 

"Above Average" ; 



( .22 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > ( -.22 * TotalAvgStDevP + ClassAvg ) ; 

"Average" ; 



( -.22 * TotalAvgStDevP + ClassAvg )  >= TotalAvg and TotalAvg > ( -.66 * TotalAvgStDevP + ClassAvg ) ; 

"Below Average" ; 



( -.66 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > ( -1.1 * TotalAvgStDevP + ClassAvg ) ; 

"Weak" ; 



( -1.1 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > ( -1.54 * TotalAvgStDevP + ClassAvg ) ; 

"Insufficient" ; 



( -1.54 * TotalAvgStDevP + ClassAvg ) >= TotalAvg and TotalAvg > 0 ; 

"IN DANGER OF FAILING" ; 



"NGR" ; 

) 
 



Once you get the calculation to return correct results, copy the formula and change your script to:


Go to Layout [ "Basics MFE" (MFE) ] 

Perform Find [ Specified Find Requests: ... [ Restore ] 

Go to Record/Request/Page [ First ] 

Loop 

Set Field [ MFE::Performance; --- PASTE YOUR FORMULA HERE --- ] 

Go to Record/Request/Page [ Next; Exit after last ] 

End Loop 

Go to Layout [ original layout ]  

You will have to manually replace the field references in the pasted formula, to include a table reference.

This topic is 7151 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.