Skip to content

Analytics & Reporting

Interactive data visualization and reporting capabilities for SAP HANA data, available through both the Web UI and the REST API.

Overview

The Analytics feature provides server-side aggregation with a secure query builder, enabling drag-and-drop data exploration, SQL-mode queries, and dashboard composition — all without writing raw SQL.

Capabilities

FeatureDescription
DimensionsGroup-by columns for categorical breakdowns
MeasuresAggregated numeric columns (SUM, AVG, COUNT, MIN, MAX)
FiltersWHERE-clause conditions with parameterized values
Cross-filtersDashboard tiles can filter each other interactively
Limit controlConfigurable row limits (1–10,000) for large datasets
Execution timingResponse includes query execution time in milliseconds

Quick Start

Via Web UI

bash
# Start the UI server
hana-cli ui

# Navigate to the Analytics workspace in the Vue UI
# Available at http://localhost:3010 under the Analytics section

The graphical workspace supports three modes:

  1. Explore — Drag dimensions and measures onto a canvas to build visualizations interactively
  2. SQL — Write and execute ad-hoc queries using the built-in query editor
  3. Dashboard — Compose multiple chart tiles into a grid layout with cross-filtering

Via REST API

Send a POST request to build and execute an aggregated query:

bash
curl -X POST http://localhost:3010/hana/analytics-ui \
  -H "Content-Type: application/json" \
  -d '{
    "schema": "MY_SCHEMA",
    "object": "SALES_DATA",
    "dimensions": ["REGION", "PRODUCT_CATEGORY"],
    "measures": [
      { "column": "REVENUE", "aggregation": "SUM", "alias": "TOTAL_REVENUE" },
      { "column": "ORDER_ID", "aggregation": "COUNT", "alias": "ORDER_COUNT" }
    ],
    "filters": [
      { "column": "YEAR", "operator": "=", "value": 2026 }
    ],
    "limit": 500
  }'

Response Format

json
{
  "columns": ["REGION", "PRODUCT_CATEGORY", "TOTAL_REVENUE", "ORDER_COUNT"],
  "data": [
    ["EMEA", "Electronics", 1250000, 3420],
    ["APAC", "Electronics", 980000, 2810]
  ],
  "metadata": {
    "totalRows": 12,
    "aggregated": true,
    "executionTime": 45
  }
}

API Reference

POST /hana/analytics-ui

Builds and executes a parameterized GROUP BY query.

Request Body

FieldTypeRequiredDescription
schemastringYesDatabase schema name
objectstringYesTable or view name
dimensionsstring[]No*Columns to group by
measuresobject[]No*Aggregated columns
filtersobject[]NoWHERE conditions
limitintegerNoRow limit (default: 1000, max: 10000)

*At least one dimension or measure is required.

Measure Object

FieldTypeRequiredDescription
columnstringYesColumn name
aggregationstringYesOne of: SUM, AVG, COUNT, MIN, MAX
aliasstringNoOutput column alias

Filter Object

FieldTypeRequiredDescription
columnstringYesColumn name
operatorstringYesOne of: =, !=, >, <, >=, <=, IN, LIKE, BETWEEN
valueanyYesScalar value, array (for IN/BETWEEN), or string

Filter Operator Details

OperatorValue TypeExample
=, !=, >, <, >=, <=Scalar{ "column": "YEAR", "operator": "=", "value": 2026 }
INNon-empty array{ "column": "REGION", "operator": "IN", "value": ["EMEA", "APAC"] }
LIKEString with wildcards{ "column": "NAME", "operator": "LIKE", "value": "SAP%" }
BETWEENArray of exactly 2{ "column": "AMOUNT", "operator": "BETWEEN", "value": [100, 500] }

Security

The analytics endpoint uses multiple layers of protection against SQL injection:

  1. Identifier validation — All schema, table, column, and alias names are validated against a strict regex (/^[a-zA-Z0-9_][a-zA-Z0-9_]*$/). Invalid identifiers are rejected with a 400 error.
  2. Identifier quoting — Validated identifiers are wrapped in double-quotes in the generated SQL.
  3. Parameterized values — All filter values are passed as prepared-statement parameters (? placeholders) — never interpolated into the SQL string.
  4. Allowlist enforcement — Only whitelisted aggregation functions and operators are accepted.

The analytics endpoint complements these CLI analysis commands:

See Also