Column Statistics (Calculate Statistics)
The Calculate statistics... functionality (opening the Column statistics dialog) provides fast and accurate descriptive statistics for any numeric column across open spatial and attribute tables, SQL query results (views), or currently selected features/rows. Because all calculations are executed directly against the device's local database engine (WebAssembly SQLite), the tool runs instantaneously both online and completely offline in the field.
How to Access the Tool
The Calculate statistics... command is available via the context menu in both the Map view and the Browser view. How you open the menu depends on your device type and where you are working:
1. From the Map View
- On Desktop Computers: Right-click anywhere on the map canvas to open the context menu and select Calculate statistics...
- On Mobile Devices and Tablets: Tap the menu display button on the left side of the map to open the context menu and select Calculate statistics...
- Via Layer Control (TOC):
- On Desktop Computers: Right-click on any vector layer in the Layer Control sidebar and select Calculate statistics...
- On Mobile Devices: Open the Layer Control sidebar, tap the menu button next to a vector layer, and select Calculate statistics...
2. From the Browser View
- Inside the Data Grid or on a Tab: On desktop computers, right-click anywhere inside the active attribute table or on a table/view tab header and select Calculate statistics... (on mobile devices, use the menu button).
- Via the Tables and Views Sidebar (TOC): Right-click (or use the mobile menu) on any table, SQL view, or Selection entry in the left sidebar of the Browser and select Calculate statistics...
The "Column statistics" Dialog
Launching the command opens the Column statistics dialog box. If no currently open table or view contains at least one numeric column, the system displays an informational message: "No tables with numeric columns are available."
Selecting the Table and Column
-
Table: A dropdown list containing all available data sources that have at least one numeric column.
Depending on your current workflow, the list includes:
- Selection (
Selection - [Table/View Name]): Appears at the very top of the list whenever features are selected on the map or rows are checked inside a standalone attribute table in the Browser. Statistics are calculated exclusively for the selected subset of records. - Active Filtered Tab (
Filter active - [Table Name]): When a base table tab in the Browser has an active filter applied via Sort/filter, this option allows you to calculate statistics specifically for the filtered rows. - SQL Views (
View - [Query Name]): Any query view created with SQL select or SQL view (e.g.,query1), automatically respecting any additional filter applied to that view tab. - Open Base Tables: All open spatial (vector) and non-spatial (attribute) tables in your workspace (internal system tables are automatically excluded).
- Selection (
-
Column: A dropdown list of all numeric columns available in the selected table or view. Each
column name is prefixed with an icon indicating its database data type (integer types such as
Smallint,Integer,Long, and floating-point/decimal types such asSingle,Double,Numeric). If a column has a user-friendly alias configured in Column Options, the alias is shown in parentheses next to the column name.
Note: Text, date/time, boolean, geometry (geom), styling (mi_style), and internal system tracking columns (such as__id__,__minx__,__ver__) are automatically excluded.
Calculated Statistical Metrics
Whenever you change the selected Table or Column, the lower panel of the dialog immediately computes and displays the following descriptive statistics (formatted according to your active application language/locale up to 4 decimal places):
| Metric | SQL / Mathematical Equivalent | Detailed Description |
|---|---|---|
| Table | Source identifier | Displays the name of the currently evaluated table, SQL view, or selection (including its layer alias in parentheses if defined). |
| Column | Field identifier | Displays the name of the evaluated numeric column. |
| Count | COUNT(x) |
Total number of records containing a valid, non-null numeric value in the selected column (empty
NULL values are ignored).
|
| Minimum | MIN(x) |
The lowest numeric value in the dataset (displays 0 when Count is 0). |
| Maximum | MAX(x) |
The highest numeric value in the dataset (displays 0 when Count is 0). |
| Range | MAX(x) - MIN(x) |
The total spread between the highest and lowest values (Maximum minus Minimum). |
| Sum | SUM(x) |
The total sum of all non-null numeric values in the column. |
| Mean | AVG(x) |
The arithmetic mean (average) of the values ($\bar{x} = \frac{\sum x}{n}$). Left blank when Count is
0.
|
| Variance | VARIANCE(x) |
Sample variance ($s^2 = \frac{\sum (x - \bar{x})^2}{n - 1}$), measuring how far the values are spread
out from their average. Displays 0 when Count is 1, and remains blank when
Count is 0. |
| Standard deviation | STDEV(x) |
Sample standard deviation ($s = \sqrt{s^2}$), expressing the dispersion of values in the same unit of measurement as the column itself. |
Integration with SQL Views, Selections, and Filters
The Column statistics dialog integrates seamlessly with Gismatrix's querying and spatial analysis tools:
-
Calculated & Spatial Columns in SQL view: If you create a custom
query using SQL view that computes dynamic values or spatial measurements (for example,
SELECT gid, ST_Area(geom) AS area_m2, ST_Length(geom) AS length_m FROM parcels), the Column statistics tool inspects the resulting columns at runtime, recognizesarea_m2andlength_mas numeric, and lets you immediately compute their total sum, average, range, and standard deviation. -
Active Sort/filter Support: Whenever a Browser view or table tab
has an active SQL filter (
WHEREclause) applied via the Sort/filter tool, the statistical calculation automatically honors that filter condition. -
Smart Context & State Persistence: The dialog remembers your last selected table and column in local
storage (
IndexedDB) per user profile, while intelligently prioritizing the specific layer, active Browser tab, or active map selection from which you invoked the command. -
Selectable Output Text: All values in the summary panel can be highlighted and copied directly to your
clipboard (
Ctrl+C/⌘C) for easy pasting into external reports or spreadsheets.