How to get a value from the previous row?

Sorry, must admit this (above) is not a bulletproof solution, just came across another more elegant one below:
check-value-with-the-previous-one:
Live & learn :))