1

I am running this

Sum(Area(obj, "sq km")), area(obj,"sq km"), count(*)

from a table

Now both areas are not the same for the objects. What one is correct?

On a created layer with 1 object I made, the values are the same, on the OS MASTER map it gives two different results.

1 Answer 1

2

Sum and Count are aggregate functions meaning that you need to Group the data by a column for them to be meaningful. In MapInfo, area(obj,"sq km"), will simply return the area for the first object that it finds whereas Sum(Area(obj, "sq km")) will sum the areas for all objects that have the same attribute value in the "Grouped By" column.

1
  • And if you don't add a Grouping expression, your result set will just contain one single row - aggregated for the entire table Mar 31, 2014 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.