View Full Version : Expression in calculated control


Danielle
04-26-2000, 02:35 PM
I have the following in an expression in a control on a report, but the syntax is wrong.

=IIf[RESOURCE TYPE]="EMPLOYEE",[Sum Of BILLABLE HRS]/[Sum Of EXP HRS ALL],[Sum Of BILLABLE HRS]/[Sum of ACTUAL HRS]-[Sum of GA07 OTHER NON PAID]

Can you please tell me what is wrong? This expression should return a percentage.

Axis
04-26-2000, 03:03 PM
Just missing a few parentheses:
=IIf([RESOURCE TYPE]="EMPLOYEE",([Sum Of BILLABLE HRS]/[Sum Of EXP HRS ALL]),([Sum Of BILLABLE HRS]/[Sum of ACTUAL HRS]-[Sum of GA07 OTHER NON PAID]))

Danielle
04-26-2000, 06:11 PM
Thanks! I tried that and the formula works if the Resource Type = Employee, but it didn't work if the Resource type was not employee. It gave a 0%. I don't know why. Do I need to add another IIf?

Danielle
04-26-2000, 06:35 PM
I just figured it out and it works. I had to add another set of parenthesis to the last calculation: ([Sum of ACTUAL HRS]-[Sum of GA07 OTHER NON PAID]).

So, it looks like this:

=IIf([RESOURCE TYPE]="EMPLOYEE",([Sum Of BILLABLE HRS]/[Sum Of EXP HRS ALL]),([Sum Of BILLABLE HRS]/([Sum of ACTUAL HRS]-[Sum of GA07 OTHER NON PAID])))

Thanks so much for your help!