ScriptExpression[] expressions = new ScriptExpression[2]; expressions[0] = new ScriptExpression( "row.COUNTRY" ); expressions[1] = new ScriptExpression( "row.AMOUNT" );  FilterDefinition filterDef = new FilterDefinition ( new ConditionalExpression("row.AMOUNT",IConditionalExpression.OP_TOP_N,"1") );
String[] bindingNameFilter = new String[3]; bindingNameFilter[0] = "FILTER_AMOUNT"; bindingNameFilter[1] = "FILTER_COUNTRY"; bindingNameFilter[2] = "FILTER_SALE_DATE"; IBaseExpression[] bindingExprFilter = new IBaseExpression[3]; bindingExprFilter[0] = new ScriptExpression( "dataSetRow.AMOUNT" ); bindingExprFilter[1] = new ScriptExpression( "dataSetRow.COUNTRY"); bindingExprFilter[2] = new ScriptExpression( "dataSetRow.SALE_DATE");
	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( ); //$NON-NLS-1$		((OdaDataSetDesign)this.dataSet).setQueryText( testSQL );				ScriptExpression[] expressions = new ScriptExpression[2];		expressions[0] = new ScriptExpression( "row.COUNTRY" ); //$NON-NLS-1$		expressions[1] = new ScriptExpression( "row.AMOUNT" ); //$NON-NLS-1$			FilterDefinition filterDef = new FilterDefinition (				new ConditionalExpression("row.AMOUNT",IConditionalExpression.OP_TOP_N,"1") );  //$NON-NLS-1$//$NON-NLS-2$				// define a query design						QueryDefinition queryDefn = newReportQuery( );						queryDefn.addFilter( filterDef );				queryDefn.addResultSetExpression( "COL_COUNTRY", expressions[0] ); //$NON-NLS-1$		queryDefn.addResultSetExpression( "COL_AMOUNT", expressions[1] );	 //$NON-NLS-1$				IPreparedQuery preparedQuery = dataEngine.prepare( queryDefn );		IQueryResults queryResults = preparedQuery.execute( null );		IResultIterator resultIt = queryResults.getResultIterator( );		outputQueryResult( resultIt, new String[]{ "COL_COUNTRY", "COL_AMOUNT"} );	  //$NON-NLS-1$//$NON-NLS-2$		checkOutputFile( );		}