I think you can achieve this by using the Statistics Component feature that you already talked about. for instance
/select?q=:&stats=true&stats.facet=Col2&stats.field=Col1
Thus, you get a statistics block with the Col2 grouping as a result, where you can access the sum value for each Col2 . But the documentation states that using stats.facet is no longer recommended.
This deprecated option is not recommended for new users - consider combining stats.field with facet.pivot instead
But I must admit that I cannot solve your use case using only the recommended stats.field with facet.pivot.
source share