Total option in Grid not show fields for selection

I generated a grid to display a pivot table.
mysql query finds records in table 1 that meet criteria defined in Table 2.
For that I use the INNER JOIN command, which generates me results in a field defined as table1.field.
When I go in the section of the total grid to define the amount you want to see, I do not appear to select fields.

How can I solve it?

scriptcase.jpg