You are right - it only happens on "output" datasets, where "output" means that running a piece of code renders a dataset that is linked to it in the Process Flow. If you delete that link in Process Flow and open the dataset directly, it is considered "input" and the WHERE command line works!

Thanks for the tip.
Regards,