Calculating grand totals in repeating group

What is the criteria for how businesses get included in the RG? i.e. what is the data source for the RG? I might have an idea for a hack workaround, but need to understand better how the RG gets constructed.