### Title

entered value triggers 1 of 3 calculations

### Post

I am putting together a school marksbook from scratch with some great help and suggestions from forum members. I have hit a bit of a wall trying to get a grade calculated.

The database has a number of student records across different year groups eg 7, 8, 9, 10. For each year there is a slightly different but rather lengthy "IF" calculation to determine the grade. I have the calculations so that is not the problem, i just cant seem to work out how to get the database to read the relevant year grouping and then apply the appropriate calculation.

do i need to set up a calculation table that has two fields (eg: year , Calculation) or is there some other way?

Thanks

Craig

If you can redesign so that the grade calculation is the same for each year, life will be simpler for you.

You could use a case function:

case ( YearGroup = 7 ; //calculation for group 7 here ;

YearGroup = 8 ; //calculation for group 8 here ;

// and so forth

)

But then you'll have to redefine this calculation to add a new expression for each new year group you add. That's cumbersome and can only be done by the developer.

A lookup table like you describe with two data fields, Year, Calculation (make calculation a text field) Could be used. Then this expression could compute the student grade: Evaluate ( calculationTable::Calculation ) for any given year group.

Still think you shouldn't really need different calculation expressions for different year groups here....