2 Replies Latest reply on Aug 22, 2016 4:52 AM by Muhammad Khan

# Calculated field do not cover all fields

Hello Everyone

I am facing some issues with my calculated filed, It doesn't cover all of the columns as shown in below picture. I also want to add some more columns to show min and max for 2nd last and last column.

if ATTR([Rate of Pay Type]) = 'Hourly' then AVG([Final Rate of Pay])

elseif attr([Rate of Pay Type]) = 'Daily' then AVG([Final Rate of Pay] / 8)

elseif attr([Rate of Pay Type]) = 'Weekly' then AVG([Final Rate of Pay]) / ([Hours / wk])

elseif attr([Rate of Pay Type]) = 'BiWeekly' then AVG([Final Rate of Pay]) / ([Hours / wk] * 2)

elseif attr([Rate of Pay Type]) = 'Monthly' then AVG([Final Rate of Pay])/ ([Hours / wk] * 4)

elseif attr([Rate of Pay Type]) = 'Annually' then AVG([Final Rate of Pay])/([Hours / wk]*50)

end Regards

Muhammad

• ###### 1. Re: Calculated field do not cover all fields

Hi Muhammad,

Your calculation uses ATTR([Rate of Pay Type]) aggregate function,

which returns NULL value if MIN([Rate of Pay Type]) != MAX([Rate of Pay Type])

ie rows with different values of [Rate of Pay Type] get aggregated into one Mark.

It is difficult to say without actually looking at the data,

but a common approach would be to calculate [\$/hr] as

SUM([Final Rate of Pay]) / SUM([Hours])

The [Hours] field in the denominator could be calculated

at Row-Level using [Rate of Pay Type] as a base field.

Hope this could help.

Yours,

Yuri

1 of 1 people found this helpful
• ###### 2. Re: Calculated field do not cover all fields

Hello Yuriy

Thank you so much for your reply, I really appreciate it.

Regrads

Muhammad