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/ExpressionCompiler.java
* Compiles a Javascript expression to produce a subclass of
	 * CompileExpression, which contains the compiled form of the JS expression,
	 * after suitable replacement of aggregate functin occurrences in the
	 * expression. Aggregate function calls that appear in the expression are
	 * registered with the provided AggregateRegistry instance.
	 * <p>
	 * Aggregate registry can be null, in which case the provided expression is
	 * expected NOT to contain aggregates. If it does, a DteException is thrown.
	 * 
	 * @param expression
	 *            Text of expression to compile
	 * @param registry
	 *            Registry for aggregate expressions. Can be null if expression
	 *            is not expected to contain aggregates
	 * @param context
	 *            Rhino context associated with current thread
	 * @return
	 */	
	public CompiledExpression compile( String expression,
			AggregateRegistry registry, Context context )
	{
		try
		{
			if ( expression == null || expression.trim( ).length( ) == 0 )
				throw new DataException( ResourceConstants.EXPRESSION_CANNOT_BE_NULL_OR_BLANK );
			this.registry = registry;
			return super.compileExpression( expression, context );
		}
		catch ( Exception e )
		{