How to get RMS value of voltage across a component

This is a very interesting method, but I cannot get it to work with pulse source.
Am I missing something? Or this method has limitation?

RMS - Total and Moving (Sine and Pulse Test Source).qsch (1.7 MB)