Class sap.ui.model.analytics.odata4analytics.QueryResultRequestModule: sap/ui/model/analytics/odata4analytics


Creation of URIs for fetching query results.

Constructor Summary
new sap.ui.model.analytics.odata4analytics.QueryResultRequest(oQueryResult, oParameterizationRequest?)Create a request object for interaction with a query result.
Method Summary
addToAggregationLevel(aDimensionName)Add one or more dimensions to the aggregation level
getAggregationLevel()Get the names of the dimensions included in the aggregation level
getAggregationLevelDetails(sDImensionName)Get details about a dimensions included in the aggregation level
getFilterExpression()Get the filter expression for this request.
getMeasureNames()Get the names of the measures included in the query result request
getParameterizationRequest()Retrieves the current parametrization request
getQueryResult()Get the description of the query result on which this request operates on
getResultPageBoundaries()Returns the current page boundaries as object with properties start and end.
getSortExpression()Get the sort expression for this request.
getURIQueryOptionValue(sQueryOptionName)Get the value of an query option for the OData request URI corresponding to this request.
getURIToQueryResultEntitySet(sServiceRootURI)Get the URI to locate the entity set for the query result.
getURIToQueryResultEntries(sServiceRootURI, sResourcePath)Get the unescaped URI to fetch the query result.
includeDimensionKeyTextAttributes(sDimensionName, bIncludeKey, bIncludeText, aAttributeName)Specify which dimension components shall be included in the query result.
includeMeasureRawFormattedValueUnit(sMeasureName, bIncludeRawValue, bIncludeFormattedValue, bIncludeUnit)Specify which measure components shall be included in the query result.
removeFromAggregationLevel(aDimensionName)Remove one or more dimensions from the aggregation level.
setAggregationLevel(aDimensionName)Set the aggregation level for the query result request.
setFilterExpression(oFilter)Set the filter expression for this request.
setMeasures(aMeasureName)Set the measures to be included in the query result request.
setParameterizationRequest(oParameterizationRequest)Set the parameterization request required for interactions with the query result of parameterized queries.
setRequestOptions(bIncludeEntityKey, bIncludeCount, bReturnNoEntities)Set further options to be applied for the OData request to fetch the query result
setResourcePath(sResourcePath)Set the resource path to be considered for the OData request URI of this query request object.
setResultPageBoundaries(start, end)Specify that only a page of the query result shall be returned.
setSortExpression(oSorter)Set the sort expression for this request.
Constructor Detail
new sap.ui.model.analytics.odata4analytics.QueryResultRequest(oQueryResult, oParameterizationRequest?)
Create a request object for interaction with a query result.
Parameters:
{sap.ui.model.analytics.odata4analytics.QueryResult}oQueryResult Description of a query parameterization
{sap.ui.model.analytics.odata4analytics.ParameterizationRequest}oParameterizationRequest? Request object for interactions with the parameterization of this query. Only required if the query service includes parameters.
Method Detail
addToAggregationLevel(aDimensionName)
Add one or more dimensions to the aggregation level
Parameters:
aDimensionName Array of dimension names to be added to the already defined aggregation level.
getAggregationLevel(): Array
Get the names of the dimensions included in the aggregation level
Returns:
{Array} The dimension names included in the aggregation level
getAggregationLevelDetails(sDImensionName): object
Get details about a dimensions included in the aggregation level
Parameters:
sDImensionName Name of a dimension included in the aggregation level of this request, for which details shall be returned
Returns:
{object} An object with three properties named key and text, both with Boolean values indicating whether the key and text of this dimension are included in this request. The third property named attributes is an array of attribute names of this dimension included in this request, or null, if there are none.
Get the filter expression for this request.

Expressions are represented by separate objects. If none exists so far, a new expression object gets created.

Returns:
{sap.ui.model.analytics.odata4analytics.FilterExpression} The filter object associated to this request.
getMeasureNames(): Array
Get the names of the measures included in the query result request
Returns:
{Array} The measure names included in the query result request
getParameterizationRequest(): sap.ui.model.analytics.odata4analytics.ParametrizationRequest
Retrieves the current parametrization request
Returns:
{sap.ui.model.analytics.odata4analytics.ParametrizationRequest}
Get the description of the query result on which this request operates on
Returns:
{sap.ui.model.analytics.odata4analytics.QueryResult} Description of a query result
getResultPageBoundaries(): Object
Returns the current page boundaries as object with properties start and end. If the end of the page is unbounded, end is null.
Returns:
{Object} the current page boundaries as object
Get the sort expression for this request.

Expressions are represented by separate objects. If none exists so far, a new expression object gets created.

Returns:
{sap.ui.model.analytics.odata4analytics.SortExpression} The sort object associated to this request.
getURIQueryOptionValue(sQueryOptionName): String
Get the value of an query option for the OData request URI corresponding to this request.
Parameters:
{String}sQueryOptionName Identifies the query option: $select, $filter,$orderby ... or any custom query option
Returns:
{String} The value of the requested query option or null, if this option is not used for the OData request.
getURIToQueryResultEntitySet(sServiceRootURI): String
Get the URI to locate the entity set for the query result.
Parameters:
{String}sServiceRootURI (optional) Identifies the root of the OData service
Returns:
{String} The resource path of the URI pointing to the entity set. It is a relative URI unless a service root is given, which would then prefixed in order to return a complete URL.
getURIToQueryResultEntries(sServiceRootURI, sResourcePath): String
Get the unescaped URI to fetch the query result.
Parameters:
{String}sServiceRootURI (optional) Identifies the root of the OData service
{String}sResourcePath (optional) OData resource path to be considered. If provided, it overwrites any parameterization object that might have been specified separately.
Returns:
{String} The unescaped URI that contains the OData resource path and OData system query options to express the aggregation level, filter expression and further options.
includeDimensionKeyTextAttributes(sDimensionName, bIncludeKey, bIncludeText, aAttributeName)
Specify which dimension components shall be included in the query result. The settings get applied to the currently defined aggregation level.
Parameters:
sDimensionName Name of the dimension for which the settings get applied. Specify null to apply the settings to all dimensions in the aggregation level.
bIncludeKey Indicator whether or not to include the dimension key in the query result. Pass null to keep current setting.
bIncludeText Indicator whether or not to include the dimension text (if available) in the query result. Pass null to keep current setting.
aAttributeName Array of dimension attribute names to be included in the result. Pass null to keep current setting. This argument is ignored if sDimensionName is null.
includeMeasureRawFormattedValueUnit(sMeasureName, bIncludeRawValue, bIncludeFormattedValue, bIncludeUnit)
Specify which measure components shall be included in the query result. The settings get applied to the currently set measures.
Parameters:
sMeasureName Name of the measure for which the settings get applied. Specify null to apply the settings to all currently set measures.
bIncludeRawValue Indicator whether or not to include the raw value in the query result. Pass null to keep current setting.
bIncludeFormattedValue Indicator whether or not to include the formatted value (if available) in the query result. Pass null to keep current setting.
bIncludeUnit Indicator whether or not to include the unit (if available) in the query result. Pass null to keep current setting.
removeFromAggregationLevel(aDimensionName)
Remove one or more dimensions from the aggregation level. The method also removed a potential sort expression on the dimension.
Parameters:
aDimensionName Array of dimension names to be removed from the already defined aggregation level.
setAggregationLevel(aDimensionName)
Set the aggregation level for the query result request. By default, the query result will include the properties holding the keys of the given dimensions. This setting can be changed using includeDimensionKeyTextAttributes.
Parameters:
aDimensionName Array of dimension names to be part of the aggregation level. If null, the aggregation level includes all dimensions, if empty, no dimension is included.
setFilterExpression(oFilter)
Set the filter expression for this request.

Expressions are represented by separate objects. Calling this method replaces the filter object maintained by this request.

Parameters:
{sap.ui.model.analytics.odata4analytics.FilterExpression}oFilter The filter object to be associated with this request.
setMeasures(aMeasureName)
Set the measures to be included in the query result request. By default, the query result will include the properties holding the raw values of the given measures. This setting can be changed using includeMeasureRawFormattedValueUnit.
Parameters:
aMeasureName Array of measure names to be part of the query result request. If null, the request includes all measures, if empty, no measure is included.
setParameterizationRequest(oParameterizationRequest)
Set the parameterization request required for interactions with the query result of parameterized queries. This method provides an alternative way to assign a parameterization request to a query result request.
Parameters:
oParameterizationRequest Request object for interactions with the parameterization of this query
setRequestOptions(bIncludeEntityKey, bIncludeCount, bReturnNoEntities)
Set further options to be applied for the OData request to fetch the query result
Parameters:
{Boolean}bIncludeEntityKey Indicates whether or not the entity key should be returned for every entry in the query result. Default is not to include it. Pass null to keep current setting.
{Boolean}bIncludeCount Indicates whether or not the result shall include a count for the returned entities. Default is not to include it. Pass null to keep current setting.
{Boolean}bReturnNoEntities Indicates whether or not the result shall be empty. This will translate to $top=0 in the OData request and override any setting done with setResultPageBoundaries. The default is not to suppress entities in the result. Pass null to keep current setting. The main use case for this option is to create a request with $inlinecount returning an entity count.
setResourcePath(sResourcePath)
Set the resource path to be considered for the OData request URI of this query request object. This method provides an alternative way to assign a path comprising a parameterization. If a path is provided, it overwrites any parameterization object that might have been specified separately.
Parameters:
sResourcePath Resource path pointing to the entity set of the query result. Must include a valid parameterization if query contains parameters.
setResultPageBoundaries(start, end)
Specify that only a page of the query result shall be returned. A page is described by its boundaries, that are row numbers for the first and last rows in the query result to be returned.
Parameters:
{Number}start The first row of the query result to be returned. Numbering starts at 1. Passing null is equivalent to start with the first row.
{Number}end The last row of the query result to be returned. Passing null is equivalent to get all rows up to the end of the query result.
setSortExpression(oSorter)
Set the sort expression for this request.

Expressions are represented by separate objects. Calling this method replaces the sort object maintained by this request.

Parameters:
{sap.ui.model.analytics.odata4analytics.SortExpression}oSorter The sort object to be associated with this request.