Trend extraction from time series is often performed by using the filter proposed by Leser (1961), also known as the Hodrick-Prescott filter. Practical problems arise, however, if the time series contains structural breaks (as produced by German unification for German time series, for instance), or if some data are missing. This note proposes a method for coping with these problems