Also add new optional output a table containing calculated statistics similar to the Statistics by categories algorithm (fix #46241)