Throughout this article, we assume that a cube instance is accessible through a variable named pivot
(we don’t discuss the type of cube instance we are dealing with or how to get it,
as this is not the focus of this article). It is also assumed that the cube includes four hierarchies:
Currency (AllMember enabled), Date (AllMember disabled), Trader (AllMember enabled) and Maturity (AllMember enabled).
GetAggregatesQuery
The goal of the GetAggregatesQuery (GAQ) is to retrieve all the aggregates that are defined by a set of locations and aggregated measures. The following code block illustrates a GAQ querying all the locations with “EUR” as currency, and requesting the aggregated measures “Quantity.SUM” and “PositionValue.SUM”. ThequeryResults contains the locations with the aggregated measures (together with their values) for each location.
DrillthroughQuery
A drillthrough query returns all the facts that have contributed to a range of selected locations. In the example below, we query all the projections that contributed to all “EUR” locations.Local Registration of a Location-Based Continuous Query
A GetAggregatesQuery or a DrillthroughQuery can be registered as a continuous query:IGetAggregatesContinuousQueryListener (shortcut for
IContinuousQueryListener<ICellSet, IVersionedContinuousQueryUpdate<ICellSet>>) for a GetAggregatesQuery, or
IContinuousQueryListener<List<IDrillthroughRow>, IContinuousQueryUpdate<List<IDrillthroughRow>>> for a DrillthroughQuery.
Here is an example of a simple printing listener for a GetAggregatesQuery: