new ConditionalExpression( "Total.sum(row.AMOUNT,null,1)", IConditionalExpression.OP_TOP_PERCENT, "50" ) ); GroupDefinition groupDefn = new GroupDefinition( ); groupDefn.setKeyExpression( "row.COUNTRY" ); groupDefn.addFilter( filterDefn );
new ConditionalExpression( "Total.sum(row.ROW_AMOUNT)", IConditionalExpression.OP_TOP_PERCENT, "40" ) );
	public void test_FilterGroup( ) throws Exception	{		String sqlStatement = "select COUNTRY,AMOUNT, SALE_DATE from " + getTestTableName( );		( ( OdaDataSetDesign )this.dataSet ).setQueryText( sqlStatement );				IBaseExpression[] expressions = new IBaseExpression[]{				new ScriptExpression( "row.COUNTRY" ),				new ScriptExpression( "row.AMOUNT" ),				new ScriptExpression( "row.SALE_DATE" )		};				String names[] = { "COL_COUNTRY", "COL_AMOUNT", "COL_SALE_DATE"};				QueryDefinition queryDefn = new QueryDefinition( );		queryDefn.setDataSetName( this.dataSet.getName( ) );				for( int i = 0; i < expressions.length; i ++ )		{			queryDefn.addResultSetExpression( names[i], expressions[ i ] );		}				FilterDefinition filterDefn = new FilterDefinition( 				new ConditionalExpression( "Total.sum(row.AMOUNT,null,1)", IConditionalExpression.OP_TOP_PERCENT, "50" ) );		GroupDefinition groupDefn = new GroupDefinition( ); 		groupDefn.setKeyExpression( "row.COUNTRY" );		groupDefn.addFilter( filterDefn );				queryDefn.addGroup( groupDefn );		IPreparedQuery preparedQuery = dataEngine.prepare( queryDefn );		IQueryResults queryResults = preparedQuery.execute( null );		IResultIterator resultIt = queryResults.getResultIterator( );				outputQueryResult( resultIt, names );		checkOutputFile( );			}