Quick Sum/Count
Ultorg perspectives can include spreadsheet-like calculations. The most common ones have dedicated shortcuts, which we describe here. Later, we will cover the general formula concept.
Row Count in Toolbar
In the upper right-hand corner of the perspective editor, you can see the total number of rows returned by a given subquery:
If there are multiple subqueries, e.g. “Courses” and “Readings” above, then the row count is done at whichever subquery the cursor is currently located. The count is of all records across all groups within that subquery, e.g. all Readings across all Courses in the example above.
By default, only the retrieved number of rows is shown (e.g. “>99 rows”). You can click the indicator, or press F9 (Data→Show Exact Row Counts), to get full counts. In this mode, Ultorg will run separate row counting queries in the background, when necessary, as you move the cursor or modify your perspective.
There's a short video demo of this feature here.
Sum/Count Action
For numeric fields, the Sum action in the context menu serves as a shortcut for creating a sum formula, at an appropriate position one or more subquery levels above the field to be summed.
If the selected field is nested in multiple subqueries, you will be prompted to select the level at which aggregation should occur.
If the context menu is opened on a subquery (bold font), a Count action is provided instead. For date and timestamp fields, a Max action is offered.
Once the formula is created, you are free to modify it or reference it from other formulas, e.g. to define more complex calculations.
Grand Totals
If the Grand Total option is selected, or is the only option available, the aggregate formula will be placed in a new subquery above the former root.
You can place other formulas at the grand total level if desired. Formulas can reference each other, or contain their own aggregate functions.