We examine a new path transform on 1-dimensional simple random walks and
Brownian motion, the quantile transform. This transformation relates to
identities in fluctuation theory due to Wendel, Port, Dassios and others, and
to discrete and Brownian versions of Tanaka's formula. For an n-step random
walk, the quantile transform reorders increments according to the value of the
walk at the start of each increment. We describe the distribution of the
quantile transform of a simple random walk of n steps, using a bijection to
characterize the number of pre-images of each possible transformed path. We
deduce, both for simple random walks and for Brownian motion, that the quantile
transform has the same distribution as Vervaat's transform. For Brownian
motion, the quantile transforms of the embedded simple random walks converge to
a time change of the local time profile. We characterize the distribution of
the local time profile, giving rise to an identity that generalizes a variant
of Jeulin's description of the local time profile of a Brownian bridge or
excursion.