  We study the importance of gravitational lensing in the modelling of the
number counts of galaxies. We confirm previous results for photometric surveys,
showing that lensing cannot be neglected in a survey like LSST since it would
infer a significant shift of cosmological parameters. For a spectroscopic
survey like SKA2, we find that neglecting lensing in the monopole, quadrupole
and hexadecapole of the correlation function also induces an important shift of
parameters. For ${\Lambda}$CDM parameters, the shift is moderate, of the order
of 0.6${\sigma}$ or less. However, for a model-independent analysis, that
measures the growth rate of structure in each redshift bin, neglecting lensing
introduces a shift of up to 2.3${\sigma}$ at high redshift. Since the growth
rate is directly used to test the theory of gravity, such a strong shift would
wrongly be interpreted as the breakdown of General Relativity. This shows the
importance of including lensing in the analysis of future surveys. On the other
hand, for a survey like DESI, we find that lensing is not important, mainly due
to the value of the magnification bias parameter of DESI, $s(z)$, which
strongly reduces the lensing contribution at high redshift. We also propose a
way of improving the analysis of spectroscopic surveys, by including the
cross-correlations between different redshift bins (which is neglected in
spectroscopic surveys) from the spectroscopic survey or from a different
photometric sample. We show that including the cross-correlations in the SKA2
analysis does not improve the constraints. On the other hand replacing the
cross-correlations from SKA2 by cross-correlations measured with LSST improves
the constraints by 10 to 20 %. Interestingly, for ${\Lambda}$CDM parameters, we
find that LSST and SKA2 are highly complementary, since they are affected
differently by degeneracies between parameters.
