That's interesting, I will propose this in class tomorrow to my students. Here's another one (okay I didn't write the material BO did. I can't figure out why a global variable isn't seen all the way through a formula.
the first formula is the standard hire year, salary, raise:
local numbervar employee_hire_year := year({Employee.Hire Date});
global numbervar cost_of_living_increase;
local currencyvar employee_salary := {Employee.Salary} * (1 + (cost_of_living_increase/100));
select employee_hire_year
case 1996:
if employee_salary > 75000 then
employee_salary * 1.1
else if employee_salary >= 35000 then
employee_salary * 1.08
else
employee_salary * 1.06
case 1997:
if employee_salary > 45000 then
employee_salary * 1.09
else
employee_salary * 1.07
case 1998:
if employee_salary > 55000 then
employee_salary * 1.09
else if employee_salary >= 30000 then
employee_salary * 1.06
else
employee_salary * 1.04
case 1999:
if employee_salary > 70000 then
employee_salary * 1.1
else
employee_salary * 1.05
the Cost of Living is declared in another formula with a global variable and called in this formula. Here is the Cost of Living Variable:
global numbervar cost_of_living_increase := 2
If you use the variable after declaration in the first formula, instead of in the employee_salary variable, then its like CR doesn't see it. For example, after all variables are declared and the cost_of_living_increase is assigned .02
select employee_hire_year
case 1996:
if employee_salary > 75000 then
(employee_salary * 1.1)*cost_of_living_increase
else if employee_salary >= 35000 then
employee_salary * 1.08 *cost_of_living_increase
etc.
Got any clues?
Thanks
muffntuf