Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum( NetWorkDays()) gives unexpected result

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

Labels (1)
0 Replies