We study the revenue-maximizing allocation of several heterogeneous, commonly ranked objects to impatient agents with privately known characteristics who arrive sequentially. There is a deadline after which no more objects can be allocated. We first characterize implementable allocation schemes, and compute the expected revenue for any implementable, deterministic and Markovian allocation policy. The revenue-maximizing policy is obtained by a variational argument which sheds more light on its properties than the usual dynamic programming approach. Finally, we use our main result in order to derive the optimal inventory choice, and explain empirical regularities about pricing in clearance sales.