As far as I can remember you can have some issues using a by when values get retained when you wouldn't expect them to. This can cause problems when an IF statement doesn't give you the value you expect. It does make sense when you think in terms of how the PDV works but it is counter-intuitive and easily catches people out.
... View more