In this Physics.SE post, there is a transformation: $$Q = q,$$ $$P = \sqrt{p} - \sqrt{q}.$$
for Hamiltonian $H = \frac{p^2}{2}$. The post discusses the validity of this transformation as a canonical transformation.
But here I'm want to ask if the transformation is valid, because the dimension of $\sqrt{p}$ is not always same with that of $\sqrt{q}$. If these two dimensions are different, how can they be connected through a minus sign, and what is the dimension of the result?