abbadonnergal

Updating & Indexing Student Status

Discussion created by abbadonnergal on Mar 18, 2016
Latest reply on Apr 14, 2016 by erolst

My client's solution is used to manage a school (with Students enrolled in Classes). Between the Students table and the Classes table there's a ClassDetail table that enables users to "enroll" students in a class... Standard stuff.

 

The client asked for a "Status" field in the Student table that updates whenever students are enrolled or not enrolled in classes (based on related values in the ClassDetail table). I accomplished this with an unstored calc (see below), but the users want to perform finds on that field and it's unbearably slow given the volume of Student records.

 

I think the best solution would be to revert this to an indexed text field and update it via script triggered by key events: students' enrollment in a class, a class ending, etc. But there may be a better way.


Does anyone have any suggestions? Thanks.

 

zcStatus field in Students table:

 

Case (

//--------------------------------------------

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"CURRENT"    )  ≥ 1

and

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"UPCOMING"    )  = 0

;

"ACTIVE" ;

//--------------------------------------------

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"CURRENT"    )  = 0

and

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"UPCOMING"    )   ≥ 1

;

"FUTURE" ;

//--------------------------------------------

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"CURRENT"    )     ≥   1

and

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"UPCOMING"    )    ≥  1

;

"CONTINUING" ;

//--------------------------------------------

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"CURRENT"    )  = 0

and

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"UPCOMING"    )   = 0

and

PatternCount (

List ( stu_CDT__ClassDetail|StudentID::zcClassStatus ) ;

"COMPLETE"    )    ≥ 1 ;

"INACTIVE" ;

//--------------------------------------------

"WILL CALL"

//--------------------------------------------

         )

Outcomes