String sqlStatement = "select COUNTRY,AMOUNT,SALE_DATE from " + getTestTableName( ); ( ( OdaDataSetDesign )this.dataSet ).setQueryText( sqlStatement );
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_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( );								}