length of service if type of position = 2 we have here:
0 (no specialists)
and here ( I changed manager into specialist in second row):
length of service if type of position = 1 we have here : 3 (but manager is now in only in first line, so it should change into 2)
length of service if type of position = 2 we have here: 3 (specialists in second row, , so it should change into 1)
length of service if type of position =1 and sector = 1,2,3,4,5 - we have here: 3 (but manager is now in only in first line, so it should change into 2)
Formulas there:
in
the third field of the Calculations section:
sum( $length_service_control[ string() castable as xs:decimal
and ../../..//type_position = '1' ], 0.0 )
in the fourth field of the Calculations section:
sum( $length_service_control[ string() castable as xs:decimal
and ../../..//type_position = '2' ], 0.0 )
in the fifth field of the Calculations section:
sum( $length_service_control[ string() castable as xs:decimal and ../sector_control = ('1', '2', '3', '4', '5') and ../../..//type_position = '1' ], 0.0 )