Your response underlines the importance of being specific and revealing up front what you are trying to do--unless you have only now changed your requirements? Anyway...
If what you wanted was the overall average, you could use the earlier method. But it seems that you want the average of the averages, not the average overall, which are two different things. To do this, I think you will have to use an unlinked subreport. Recreate the elements of your report in the subreport, and then create two formulas:
//{@sumave} to be placed in the subreport group header/footer where you have the averages:
whileprintingrecords;
shared numbervar sumave := sumave + average({table.income},{table.city};
//{@aveave} to be placed in the subreport report footer:
whileprintingrecords;
shared numbervar sumave;
shared numbervar aveave;
aveave := sumave/distinctcount({table.city})
Suppress all subreport sections except the report footer
In the main report insert a new group section and toggle the new section (in format->section) so that it becomes section a. Place the subreport in group header/footer_a section.
In the main report create a formula {@counter} to be placed in group header/footer section_b:
whileprintingrecords;
shared numbervar aveave;
numbervar counter;
if aveave > Average ({Orders.Order Amount}, {Orders.Customer ID}) then
counter := counter else counter := counter + 1
Then go to format section->group header/footer_a->suppress->x+2 and enter:
whileprintingrecords;
shared numbervar aveave;
numbervar counter;
aveave < average({table.income},{table.city}) or
counter > 0
That should do it. I will test this more thoroughly later--no time now.
-LB