Each Analytics statement produces a set of virtual Oracle Commerce Guide Search records that can be used in application code like any other Oracle Commerce Guide Search records (ERec objects).
Results for a statement can be retrieved using the name for that statement. For example, if we used a query like:
RETURN "Product Totals" AS ...
Then we could retrieve the results as follows:
ENEQueryResults results = ...
AnalyticsStatementResult analyticsResults;
analyticsResults = results.getNavigation().
getAnalyticsStatementResult("Product Totals");
The AnalyticsStatementResult object provides access to an iterator over the result records, for example:
Iterator recordIter = analyticsResults.getERecIter();
The AnalyticsStatementResult object also provides access to the total number of result records associated with the statement (which may be greater than the number returned if a PAGE operator was used).
The AnalyticsStatementResult object also provides access to an error message for the analytics statement. The error message, if not null, provides information about why the query could not be evaluated.
The MDEX Engine may evaluate some of the statements in an analytics request but not others if errors in the statements (for example, use of a non-existent group-by key) are independent.
In addition to per-statement error messages, the Navigation object provides access to a global error message for the complete analytics query. This can be non-null in cases where statement evaluation was not possible because of query-level problems, for example not all statements being assigned unique names.

