Bug 146967 Total fuction with result of the aggregate on group-Level should be enhanced
Description: Now if we want to do total fuction with the Aggregate result on the group level, it cant be fulfilled. For example, we set a total.sum() aggregate on a group level first, and then we sum the result of total.sum() again. The expected result should simply equal to sum over all rows. But the actual result is not as our requirement. I attached the design file as the example. Expected result: The aggregation on the group total should be enhanced, or we cant get expected result such as the requirement that total.rank() with the average result on the group level and so on.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedQuery.java
}
		
		if( prefix != null )
		{
			ce = new ConditionalExpression( prefix+"("
					+ ce.getExpression( ).getText( ) + ","
					+ ce.getOperand1( ).getText( ) + ")",
					IConditionalExpression.OP_TRUE );
		}
		return ce;
	}
	
	/**
	 * Return the QueryResults. But the execution of query would be deferred
	 * 
	 * @param outerResults
	 *            If query is nested within another query, this is the outer
	 *            query's query result handle.
	 * @param scope
	 *            The ElementState object for the report item using the query;
	 *            this acts as the JS scope for evaluating script expressions.
	 * @param executor
	 * @parem dataSourceQuery
	 */
	QueryResults doPrepare( IQueryResults outerResults,
			Scriptable scope, QueryExecutor executor,
			PreparedDataSourceQuery dataSourceQuery ) throws DataException
	{
		if ( this.baseQueryDefn == null )
		{