Set @TotalParticipantNr_BeginP =
CASE WHEN
(Sum(@CVD12Nr_BeginP + @CVD34Nr_BeginP + @CVD56Nr_BeginP + @CVD78Nr_BeginP + @CVD910Nr_BeginP + @IDONTKNOWNr_BeginP + @MissedNr_BeginP)) > 100 then 100 else
Set @TotalParticipantNr_BeginP = (Sum(@CVD12Nr_BeginP + @CVD34Nr_BeginP + @CVD56Nr_BeginP + @CVD78Nr_BeginP + @CVD910Nr_BeginP + @IDONTKNOWNr_BeginP + @MissedNr_BeginP))
end
That is a workaround.
The problem is that when you round things up at each point, you inevitably get a sum that is not equal to the total.
Simple case of two components that end up with 45.5 and 54.5.
If you show them at a round number, they will be 46 and 55. 46+55 = 101.