IBaseExpression[] expressions = new IBaseExpression[]{ new ScriptExpression( "row.COUNTRY", 0), new ScriptExpression( "row.AMOUNT",2 ), new ScriptExpression( "row.SALE_DATE",6 ) }; String names[] = { "COL_COUNTRY", "COL_AMOUNT", "COL_SALE_DATE"};
String[] bindingNameRow = new String[6]; bindingNameRow[0] = "ROW_0"; bindingNameRow[1] = "ROW_rowPosition"; bindingNameRow[2] = "ROW_COUNTRY"; bindingNameRow[3] = "ROW_CITY"; bindingNameRow[4] = "ROW_SALE_DATE"; bindingNameRow[5] = "ROW_AMOUNT"; IBaseExpression[] bindingExprRow = new IBaseExpression[6]; bindingExprRow[0] = new ScriptExpression( "dataSetRow[0]" ); bindingExprRow[1] = new ScriptExpression( "dataSetRow._rowPosition" ); bindingExprRow[2] = new ScriptExpression( "dataSetRow.COUNTRY" ); bindingExprRow[3] = new ScriptExpression( "dataSetRow.CITY" ); bindingExprRow[4] = new ScriptExpression( "dataSetRow.SALE_DATE" ); bindingExprRow[5] = new ScriptExpression( "dataSetRow.AMOUNT" );  GroupDefinition[] groupDefn = null; SortDefinition[] sortDefn = null;  String[] bindingNameFilter1 = new String[1]; bindingNameFilter[0] = "FILTER_AMOUNT"; IBaseExpression[] bindingExprFilter1 = new IBaseExpression[1]; bindingExprFilter[0] = new ScriptExpression( "dataSetRow.AMOUNT" );  FilterDefinition[] filters = new FilterDefinition[]{ new FilterDefinition( new ConditionalExpression("row.FILTER_AMOUNT",IConditionalExpression.OP_BOTTOM_N,"3"))};
	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 )		};		String names[] = { "COL_COUNTRY", "COL_AMOUNT", "COL_SALE_DATE"};				FilterDefinition filterDefn = new FilterDefinition(				new ConditionalExpression("row.SALE_DATE", IConditionalExpression.OP_BOTTOM_N,"3"));				QueryDefinition queryDefn = new QueryDefinition( );		queryDefn.setDataSetName( this.dataSet.getName( ) );				queryDefn.addFilter( filterDefn );				for( int i = 0; i < expressions.length; i ++ )		{			queryDefn.addResultSetExpression( names[i], expressions[ i ] );		}				IPreparedQuery preparedQuery = dataEngine.prepare( queryDefn );		IQueryResults queryResults = preparedQuery.execute( null );		IResultIterator resultIt = queryResults.getResultIterator( );		outputQueryResult( resultIt, names );		checkOutputFile( );								}