System.out.print( resultIt.getValue( expressions[0] ) ); System.out.print( resultIt.getValue( expressions[1] ) );
System.out.print( resultIt.getValue( names[0] ) ); System.out.print( resultIt.getValue( names[1] ) );
	public void test_SortOnAggregationExpression() throws Exception	{		// Test a SQL with duplicate column name (quite common with join data sets)		String testSQL =  "select COUNTRY, AMOUNT from " + getTestTableName( );		((OdaDataSetDesign)this.dataSet).setQueryText( testSQL );				IBaseExpression[] expressions = new IBaseExpression[]{				new ScriptExpression( "row.COUNTRY", 0 ),				new ScriptExpression( "row.AMOUNT", 2 ),				new ScriptExpression( "Total.runningSum(row.AMOUNT)", 2 ) };		SortDefinition[] sortDef = new SortDefinition[]{ new SortDefinition() };		sortDef[0].setExpression( "row.AMOUNT/Total.sum(row.AMOUNT)" );		sortDef[0].setSortDirection( ISortDefinition.SORT_DESC );						// define a query design						QueryDefinition queryDefn = newReportQuery( );		queryDefn.addSort(sortDef[0]);						queryDefn.addExpression(expressions[0], BaseTransform.ON_EACH_ROW);		queryDefn.addExpression(expressions[1], BaseTransform.AFTER_LAST_ROW);					IPreparedQuery preparedQuery = dataEngine.prepare( queryDefn );		IQueryResults queryResults = preparedQuery.execute( null );		IResultIterator resultIt = queryResults.getResultIterator( );		assertTrue( resultIt.next() );				resultIt.getValue( expressions[0] );		resultIt.getValue( expressions[1] );			System.out.print( resultIt.getValue( expressions[0] ) );		System.out.print( resultIt.getValue( expressions[1] ) );				resultIt.next();		System.out.print( resultIt.getValue( expressions[0] ) );		System.out.print( resultIt.getValue( expressions[1] ) );		resultIt.next();		System.out.print( resultIt.getValue( expressions[0] ) );		System.out.print( resultIt.getValue( expressions[1] ) );		resultIt.next();		System.out.print( resultIt.getValue( expressions[0] ) );		System.out.print( resultIt.getValue( expressions[1] ) );		resultIt.next();		System.out.print( resultIt.getValue( expressions[0] ) );		System.out.print( resultIt.getValue( expressions[1] ) );		}