Duplicate summary records

OK. This is probably obvious to experienced users but I’ve tried everything I know how to do and no joy. Here is some raw data:

Screen Shot 2021-03-28 at 4.58.51 PM

If I run this procedure:

select name = “Mary Cool”
field name groupup
field Due total

I get this:

Screen Shot 2021-03-28 at 4.59.12 PM

I don’t know why I’m getting TWO summary records instead of one. Suggestions?

The second is the grand total summary. When you group up, you get a summary record for each group, and one summary for the database. The grand total is a level two summary. The group summaries are level one.

Selection is an action that occurs at a point in time. Once that action is complete, there is nothing to stop you (or a program) from modifying the database so that data that doesn’t match the selection formula becomes visible.

In this case, your first line of code does the selection, so there will be only two visible records at that point. The next statement, group, adds two records to the database, as Dave described. These new records have nothing to do with the selection, since they were created after the selection was performed. So you wind up with two data records that were selected, and two new summary records that were created by the group statement. The group statement will always create at least two records, a level one summary and a grand total summary. Of course usually it will create more than one level one summary, but in this case it didn’t because you only had one name selected.

Thanks. That’s very helpful. Actually all I wanted to do was to make the grand total record not appear in a report. I achieved this by including a summary 2 tile in the report with height set to 0. Seemed a bit clunky to me. . but it worked so I got no complaints.

If you are only selecting the one name, so that there will only be one group, you can do the total without grouping at all. It will create a grand total summary (at level one) and that will be the only summary.