Material Attributes + If statements - How to switch material attribute based on world height?

I did eventually did this, which seems to have one material below 0 z, and another above it:


and as ClockworkOcean said, it looks quite weird:

I don’t know how to, i tried this:


with… uhm.. strange results:

Could you please elaborate?