After checking the posts a bit better I noticed that my question is not that far off with this post: Sum of value of all items in array - iPaaS Transformers / General - Alumio
I managed to get it working by filtering out the nodes that contain the unwanted values like this:
test-sum-transformer_transformer.ndjson (3.7 KB)
Thanks @r.candrian for your explanation and example in the other topic.