There are the following procedure for creating a query:
There are the following procedure for creating a query:There are the following procedure for creating a query:
1. Make a cube for a query.
2. Make an instance of the OLAPOuery class which is used to represent the query.
3. Make an instance of the OLAPQueryAxis class to represent the rows of the
query.
4. Make an instance of the OLAPSet class to define the members that provide the
row axis information.
5. Make an instance of the OLAPQueryAxis class to represent the columns of the
query.
6. Make an instance of the OLAPSet class to define the members that provide the
column axis information.
7. Make an instance of the OLAPQueryAxis class to specify a slicer axis
(Optionally).
8. Make an instance of the OLAPSet class to define the members that provide the
slicer axis information.
9. Execute the Query.
10.Now pass the query results to the OLAPDataGrid control.
|
// Create Quary query.getAxis(OLAPQuery.ROW_AXIS); productSet.addElements( cube.findDimension( "ProductDimention").findAttribute("Product").children);rowQueryAxis.addSet(productSet); // instance of OLAPQueryAxis class for columnquery.getAxis(OLAPQuery.COLUMN_AXIS); // instance of OLAPSet classquarterSet.addElements( cube.findDimension( "QuarterDimention").findAttribute("Quarter").children);colQueryAxis.addSet(quarterSet); return query;} token.addResponder( new AsyncResponder(showResult, showFault));} // Query Fault public function showFault(result:Object, token:Object):void {Alert.show( "Error in query.");} // Query SuccessAlert.show( "No results from query.");} productDataGrid.dataProvider= result as OLAPResult;} |