how to remove the last linked whole note without removing everything ?

Simple example (see image): how to remove the last linked whole note without removing everything from the full initial value and having to recalculate the length? You should only be able to delete the linked value of the last measure. (Sorry for my English)

Can you maneuver the caret to the first beat (or any other beat of that measure as desired) of that measure and press U?

Or just select the note, then use Shift-Alt-Left arrow repeatedly to trim the note by the grid value.

Two good ways to do it. Thank you very much!