Added nPercentile and keepLastValue