sum( {$<[ResourceId Hours per week] = {">0"} >} (NetWorkDays($(vBeginDate4), $(vEndDate4)) * 8 * 60 * $(vTimeUnitFactor) * [ResourceId Hours per week]/40) -
if([Unavailable Start Date] < $(vEndDate4) and [Unavailable End Date] > $(vBeginDate4),
(NetWorkDays(if([Unavailable Start Date] < $(vBeginDate4), $(vBeginDate4), [Unavailable Start Date]),
if([Unavailable End Date] < $(vEndDate4), [Unavailable End Date], $(vEndDate4))) * 8 * 60 * $(vTimeUnitFactor) * [ResourceId Hours per week]/40 )
, 0
)
)
What i,m trying to do is calculate nettoworkdays: totaal workdays - unavailable days
The unavailable days are in a separate table and link via a ResourceId?
The problem is, when there are only 0 or 1 unavailable days records in a specific period, the calculation works fine.
But when there are more I get enexpected results e:g
Numer of unavailable days = 18
Bruto workdays = 92
Expected = 74
Count( 'above expresion' ) gives = 3
So I assume that the problem somehow is related to the number of unavailable days records.
Gerry