Calculations Without Changing the Query
Interactive Reports support two types of computed columns: developer-defined computed columns in the SQL source, and user-defined computed columns created through the Actions menu at runtime. Both let you add calculations, string manipulations, and conditional logic to the report without modifying the base query.
Developer-Defined Computed Columns
Add calculated columns directly in your SQL query:
SELECT order_id, customer_name, quantity, unit_price,
quantity * unit_price AS line_total,
CASE
WHEN quantity * unit_price > 1000 THEN 'High'
WHEN quantity * unit_price > 100 THEN 'Medium'
ELSE 'Low'
END AS value_tier,
ROUND(MONTHS_BETWEEN(SYSDATE, order_date), 1) AS age_months
FROM orders;
These columns appear as regular IR columns. Users can filter, sort, and aggregate them like any other column. They are always available and consistent for all users.
User-Defined Computed Columns
Users create these through Actions, then Compute. They can reference other columns using the column aliases prefixed with letters (A = first column, B = second, etc.) and use a set of built-in functions:
-- User-created computation examples:
-- Profit margin: (D - E) / D * 100 (where D = revenue, E = cost)
-- Full name: B || ' ' || C (where B = first, C = last)
-- Days overdue: SYSDATE - F (where F = due_date)
Aggregates
IR aggregates add summary rows at the bottom of the report or at control break points. Users add them through Actions, then Aggregate. Available aggregate functions are Sum, Average, Count, Min, Max, Median, and Count Distinct. You can have multiple aggregates simultaneously showing sum of revenue and count of orders on the same report.
Control Break Aggregates
Combine control breaks with aggregates for grouped subtotals. Add a control break on Department, then add a Sum aggregate on Salary. The report shows each department as a group with a subtotal row after each group and a grand total at the bottom. Users love this feature because it turns a flat report into a structured summary without any developer effort.
Developer Tip: Pre-Create Default Aggregates
Save a default report with pre-configured aggregates so users see summary data immediately. Create the report, add the aggregates interactively, then save it as the Primary Default report. Users can modify or remove them, but the defaults provide immediate value.