queryDefn.addExpression(expressions[0], BaseTransform.ON_EACH_ROW); queryDefn.addExpression(expressions[1], BaseTransform.AFTER_LAST_ROW);
queryDefn.addResultSetExpression( "COL_COUNTRY", expressions[0] ); queryDefn.addResultSetExpression( "COL_AMOUNT", expressions[1] );
	public void test_FilteWithTopN() 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 )};			FilterDefinition filterDef = new FilterDefinition (				new ConditionalExpression("row.AMOUNT",IConditionalExpression.OP_TOP_N,"1") );				// define a query design						QueryDefinition queryDefn = newReportQuery( );						queryDefn.addFilter( filterDef );				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( );		outputQueryResult( resultIt, expressions );			checkOutputFile( );		}