Odd Maximum Result

On a numeric field set to integer, any group that has no values entered results in a Maximum result of -9223372036854775807

Average and Minimum work as I would expect.

Screenshot 2023-05-23 at 6.05.46 AM

Ok, I’ve put this in the bug report database. But I’m not sure what the expected value should be. You are asking it to determine the maximum of an empty set. That is really an undefined value. I guess the best solution would be to leave the summary value empty, but I think that will require quite a hack.

BTW, -9223372036854775807 is the largest possible negative integer. The maximum calculation starts with that value, then scans the database increasing the value as it finds larger values. In this case, there are no larger values, so you’re left with the largest possible negative value.

I’m a bit surprised that minimum does work. Maybe I already made a special case for that – I’ll have to look into it.

Since Maximum can also be used on Text fields, an empty result would be what I’d expect when there is nothing. That would be just the same as what I get with Average and Minimum. But even a zero would make sense when that’s the maximum value of an empty numeric field.

Does it? If the field could contain negative numbers then that wouldn’t make sense at all.

It turns out that the work of quite a hack had already been done for the Minimum operation. It was trivial to enable the same hack for Maximum. So this will be fixed in the next version (if there are no non-empty values, the result will be empty).