Good question, I have such a situation upcoming as well.
On a recent booking I checked in for legs 3 and 4, but only flew 3 (was a no-show on leg 4). The miles credited as if I had flown the last leg. So i plan to do the same with my upcoming flight.