Fix gross_profit_common.py and add elementwise grouping to report