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/expression/AbstractExpressionCompiler.java
Interpreter compiler = new Interpreter( );
		Object compiledOb = compiler.compile( compilerEnv, tree, null, false );
		Script script = (Script) compiler.createScriptObject( compiledOb, null );
		( (BytecodeExpression) expr ).setScript( script );
	}
	/**
	 * An aggregation expression in the form of Total.xxx for example Total.sum(
	 * row.x ) This means the first child is a GETPROP node, and its left child
	 * is "Total" and its right child is "sum"
	 * 
	 * @param callNode
	 * @return @throws
	 *         DataException
	 */
	protected IAggregation getAggregationFunction( Node callNode )
			throws DataException
	{
		Node firstChild = callNode.getFirstChild( );
		if ( firstChild.getType( ) != Token.GETPROP )
			return null;
		Node getPropLeftChild = firstChild.getFirstChild( );
		if ( getPropLeftChild.getType( ) != Token.NAME
				|| !getPropLeftChild.getString( ).equals( TOTAL ) )
			return null;
		Node getPropRightChild = firstChild.getLastChild( );
		if ( getPropRightChild.getType( ) != Token.STRING )
			return null;
		String aggrFuncName = getPropRightChild.getString( );
		IAggregation agg = AggregationFactory.getInstance( )
				.getAggregation( aggrFuncName );