{"ref":"capability:analytical-queries","page":"/capabilities/analytical-queries","json":"/capabilities/analytical-queries.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"analytical-queries","name":"Analytical queries","domain":"data-and-persistence","ecosystems":["cap"],"universal":false,"description":"Grouped, aggregated and filtered reads for analytical clients, answered by the database rather than in application memory. This concerns the queries a chart or report sends, while [analytic modelling](capability:analytic-modelling) defines the measures and dimensions they read.","short":"Grouped, aggregated reads for analytical clients, run in the database","core_coverage":{"state":"core-only","assessed_at":"2026-09-20","what_core_does":"Both runtimes answer the [OData](capability:odata) V4 `$apply` query option as a pipeline of transformations: `filter`, `groupby`, `aggregate`, `concat`, `skip`, `top` and `orderby`, with `min`, `max`, `sum`, `average`, `countdistinct` and `$count` as aggregation methods. A measure annotated with `@Aggregation.default` is exposed as a custom aggregate the client names without knowing how it is calculated.","where_it_stops":"It stops at the transformations capire's table marks n/a for both runtimes: `topcount`, `toppercent` and `topsum` with their bottom counterparts, `expand`, `groupby` with `rollup` or `$all`, and custom aggregation methods; `search` and `compute` inside `$apply` are answered by CAP Java and not by [@sap/cds](artifact:sap-cds). The hierarchy transformations `TopLevels`, `ancestors` and `descendants` are there only to support requests from the UI5 Tree Table, and `concat` has to end the pipeline and rules out every other system query option.","sources":[{"url":"https://cap.cloud.sap/docs/guides/protocols/odata#data-aggregation","title":"Serving OData APIs — Data Aggregation","checked":"2026-09-20","quote":"Data aggregation in OData V4 is leveraged by the $apply system query option, which defines a pipeline of transformations that is applied to the input set specified by the URI."},{"url":"https://cap.cloud.sap/docs/guides/protocols/odata#transformations","title":"Serving OData APIs — Data Aggregation, transformations table","checked":"2026-09-20","quote":"only to support requests from the UI5 Tree Table"}]},"history":[{"date":"2026-08-31","field":"core_coverage.state","from":"core","to":"core-only","reason":"States renamed to describe who is present rather than to interpret intent. left-open-on-purpose asserted a motive; core-and-community states a fact, with relationship carrying the intent separately."},{"date":"2026-09-10","field":"id","from":"analytics","to":"analytical-queries","reason":"\"analytics\" is the generic word for a whole product family, and this capability is one narrow thing inside CAP: $apply compiled into database aggregation. Somebody looking for where Datasphere or Analytics Cloud live found this and reasonably concluded the atlas had them. The id and the name now say which of the two it is, and the description says which it is not."},{"date":"2026-10-17","field":"description","from":"Grouped, aggregated and filtered reads for analytical clients — the query shapes an analytical UI issues, answered by the database rather than in memory. Named for the query and not for the field: this is what a CAP service does when a chart asks it something, and it is not the analytics estate — Datasphere, Analytics Cloud, BW and the modelling that happens in them are a different concern on a different door.","to":"Grouped, aggregated and filtered reads for analytical clients, answered by the database rather than in application memory. This concerns the queries a chart or report sends, while [analytic modelling](capability:analytic-modelling) defines the measures and dimensions they read.","reason":"Keep the default capability wording neutral; preserve the previous wording in framing_by_ecosystem.cap. Maintainer-requested scope audit."}],"drafted_with_ai":true,"framing_by_ecosystem":{"cap":{"description":"Grouped, aggregated and filtered reads for analytical clients — the query shapes an analytical UI issues, answered by the database rather than in memory. Named for the query and not for the field: this is what a CAP service does when a chart asks it something, and it is not the analytics estate — Datasphere, Analytics Cloud, BW and the modelling that happens in them are a different concern on a different door."}}},"sap_delivery":{"door":"cap","all":{"built_in":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"}],"documented_pattern":[],"announced":[],"packages":[]},"by_flavor":{"node":{"built_in":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"}],"documented_pattern":[],"announced":[],"packages":[]},"java":null}},"edges":{"use_cases":[],"shared_tasks":[],"related_tasks":[],"options":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json","ecosystem":"cap","origin_ring":"sap-official"}],"samples":[{"ref":"artifact:miyasuta-blog-cap-chart","name":"blog-cap-chart","json":"/artifacts/miyasuta-blog-cap-chart.json"},{"ref":"artifact:miyasuta-cap-alp","name":"cap-alp","json":"/artifacts/miyasuta-cap-alp.json"},{"ref":"artifact:gregorwolf-cap-sflight-hierarchy","name":"cap-sflight-hierarchy","json":"/artifacts/gregorwolf-cap-sflight-hierarchy.json"}],"explained_by":[{"ref":"content:understanding-csn-and-its-role-in-embedded-analytics","name":"SAP Incentive Management - Understanding of CSN file & CLI Command to generate","json":"/content/understanding-csn-and-its-role-in-embedded-analytics.json"},{"ref":"content:building-an-analytical-list-page-with-cap-odata-v4","name":"Building an Analytical List Page with CAP OData V4","json":"/content/building-an-analytical-list-page-with-cap-odata-v4.json"},{"ref":"content:fiori-elements-analytical-table-with-cap-does-it-work-with-v2-and-v4","name":"Fiori Elements Analytical Table with CAP: Does it work with V2 and V4?","json":"/content/fiori-elements-analytical-table-with-cap-does-it-work-with-v2-and-v4.json"},{"ref":"content:empowering-your-data-analytics-with-gpt-3-and-sap-cap-integration","name":"Empowering Your Data Analytics with GPT-3 and SAP CAP Integration","json":"/content/empowering-your-data-analytics-with-gpt-3-and-sap-cap-integration.json"},{"ref":"content:sap-data-and-analytics-showcase-cap-machine-learning-application","name":"SAP Data and Analytics Showcase – Use SAP Cloud Application Programming Model to Develop a Machine Learning Application on SAP BTP","json":"/content/sap-data-and-analytics-showcase-cap-machine-learning-application.json"},{"ref":"content:sap-data-and-analytics-showcase-machine-learning-on-btp","name":"SAP Data and Analytics Showcase - Develop a Machine Learning Application on SAP BTP","json":"/content/sap-data-and-analytics-showcase-machine-learning-on-btp.json"},{"ref":"content:predictive-asset-insights-embedded-live-analytics-using-cap-and-sac","name":"Predictive Asset Insights embedded Live analytics using CAP and SAC","json":"/content/predictive-asset-insights-embedded-live-analytics-using-cap-and-sac.json"},{"ref":"content:discovering-fiori-elements-analytical-functions-with-sap-support-messages","name":"Discovering SAP Fiori Elements Analytical functions by implementing SAP Support Message Reporting","json":"/content/discovering-fiori-elements-analytical-functions-with-sap-support-messages.json"},{"ref":"content:e2e-sap-iot-to-sap-analytics-cloud","name":"E2E: SAP Cloud Platform Internet of Things to SAP Analytics Cloud","json":"/content/e2e-sap-iot-to-sap-analytics-cloud.json"}],"normative_context":[]}}