My contention is that YOU DO NOT WANT TO CREATE THE REPORT DIRECTLY FROM THAT DATASOURCE, you want to have another local table with a 'conversion' from the raw GL number to something your report can use to sort and group. You are attempting to create all your sorting and grouping with formulas and that is a mistake. You will regret it and it is going to be extremely difficult to update if you ever add or change gl codes related to this report.
In short, use a table that converts your GL codes to something usable for grouping/summing on your report.