queryDefn.addExpression(expressions[0], BaseTransform.ON_EACH_ROW); queryDefn.addExpression(expressions[1], BaseTransform.ON_EACH_ROW); queryDefn.addExpression(expressions[2], BaseTransform.ON_EACH_ROW);
for( int i = 0; i < expressions.length; i ++ ) { queryDefn.addResultSetExpression( names[i], expressions[ i ] ); }
	public void test_FilterWithBottomN( ) throws Exception	{				String sqlStatement = "select COUNTRY,AMOUNT,SALE_DATE from " + getTestTableName( );		( ( OdaDataSetDesign )this.dataSet ).setQueryText( sqlStatement );				IBaseExpression[] expressions = new IBaseExpression[]{			new ScriptExpression( "row.COUNTRY", 0),			new ScriptExpression( "row.AMOUNT",2 ),				new ScriptExpression( "row.SALE_DATE",6 )		};						FilterDefinition filterDefn = new FilterDefinition(				new ConditionalExpression("row.SALE_DATE", IConditionalExpression.OP_BOTTOM_N,"3"));				QueryDefinition queryDefn = new QueryDefinition( );		queryDefn.setDataSetName( this.dataSet.getName( ) );//		QueryDefinition queryDefn = newReportQuery( );				queryDefn.addFilter( filterDefn );				queryDefn.addExpression(expressions[0], BaseTransform.ON_EACH_ROW);		queryDefn.addExpression(expressions[1], BaseTransform.ON_EACH_ROW);		queryDefn.addExpression(expressions[2], BaseTransform.ON_EACH_ROW);				IPreparedQuery preparedQuery = dataEngine.prepare( queryDefn );		IQueryResults queryResults = preparedQuery.execute( null );		IResultIterator resultIt = queryResults.getResultIterator( );		outputQueryResult( resultIt, expressions );		checkOutputFile( );								}