Let $S_n$ be the symmetric group on $\{1,2,\ldots, n\}$ and $\ell$ the Coxeter length on $S_n$. There is a well-known formula to compute this length, namely for a $\pi \in S_n$ we have $$\ell(\pi) = |\{1 \leq i < j \leq n \mid \pi(i) > \pi(j)\}|.$$ Furthermore, we know that $$\sum_{\pi \in S_n} sign(\pi) \ell(\pi) = 0$$ for all $n \geq 4$. So I was wondering: What about other characters or class functions? Given a class function $f \in Cl_{\mathbb{Q}}(S_n)$, what can we say about $$\sum_{\pi \in S_n} f(\pi)\ell(\pi)\,\,\, ?$$ What about the case where $f$ is an irreducible character? Given that the length is already known for a long time, I was rather sure that this problem has already been solved. However, I couldn't even find $$\sum_{\pi \in S_n} \ell(\pi) fix(\pi) = \frac{n!n(n-1)}{4} - \frac{(n+1)!}{6}$$ in the OEIS, where $fix(\pi)$ denotes the number of fixed points of $\pi$ (and yes, the two summands there are exactly the sum for the two irreducible characters that make up $fix$).

So, after this long introduction, my question is: Did someone already consider this question and am I just not able to find their work? Does anyone here know of a paper mentioning or even solving this problem, is there an application of such a solution in the study of the Coxeter length or other combinatorial functions? Can you suggest any paper, author, book,... where I might find something about this topic, is there maybe a standard textbook on combinatorial representation theory?