Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Unexplainable Script Behavior

Featured Replies

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

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.

  • Author

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.

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.