Sparse Matrix Generation for Data Element Statistics (optimized)