How to use the reduce functions in alert condition?

I replied in the original thread due to the context being missing here.