Thanks for the tip - i tried multiplying by 1.0 but I believe it's a namespace error.

The error message indicates "A column with name `count(*) / count(distinct field1)` is not found."

After some testing, this only occurs when the distinct keyword is used.