  The spatial distribution of Galactic stars with different chemical abundances
encodes information on the processes that drove the formation and evolution of
the Milky Way. Survey selection functions are indispensable for analysing
astronomical catalogues produced by large-scale surveys. The use of these
selection functions in data modelling is more complex when data from different
surveys are to be modelled simultaneously. We introduce a procedure for
constructing the selection function of a sample of red clump stars that have
parallaxes and elemental abundances from the Gaia mission. We separately
constructed the selection function of the APOGEE DR17 red clump stars, which
depends on very different observables and has a very different spatial
coverage. We combined the two surveys and accounted for their joint selection
function to provide strong constraints on the radial and vertical density
distribution of mono-abundance populations, with Gaia offering a dense coverage
of the solar neighbourhood, while APOGEE reaches larger distances near the
Galactic plane. We confirm that the radial density profile steepens with
increasing metallicity. The combined sample also indicates a
metallicity-dependent flaring of the alpha-poor disc. We provide the code for
constructing the Gaia selection function we used in this study through the
GaiaUnlimited Python package.
