I came across the following rule and I felt that it was inefficient but just wanted to check here in case I missed something.
The rule is as follows:
Code: Select all
[ 'Costing %'] =N:
IF( [ 'Forecast Flag' ] = 1 &
DB('Appointment data',Version,Year,Cost Centre,Employee,Position,'Costing %') <> 0,
DB('Appointment data',Version,Year,Cost Centre,Employee,Position,'Costing %'),
STET
);
[ 'Forecast Flag' ]=>[ 'Costing %'];
I don't get why the DB is needed in the above rule, so I was thinking this would be better:
Code: Select all
[ 'Costing %'] =N:
IF( [ 'Forecast Flag' ] = 1,
DB('Appointment data',Version,Year,Cost Centre,Employee,Position,'Costing %'),
STET
);
Then I remembered that IF statements should be avoided if possible, so I was thinking this was even better:
Code: Select all
[ 'Costing %'] =N:
[ 'Forecast Flag' ] *
DB('Appointment data',Version,Year,Cost Centre,Employee,Position,'Costing %');
Can anyone confirm that the above is correct?
Maren