Create query for contribution statistic