outputQueryResult( resultIt, names ); checkOutputFile( );
IBaseExpression[] bindingExprGroup = new IBaseExpression[2]; bindingExprGroup[0] = new ScriptExpression( "dataSetRow.COUNTRY" ); bindingExprGroup[1] = new ScriptExpression( "dataSetRow.CITY" );  GroupDefinition[] groupDefn = new GroupDefinition[]{ new GroupDefinition( "group0"), new GroupDefinition( "group1")}; groupDefn[0].setKeyExpression( "row.GROUP_GROUP0" );  groupDefn[1].setKeyExpression( "row.GROUP_GROUP1" );   groupDefn[0].addFilter( filterDefn );  String[] bindingNameRow = new String[4]; bindingNameRow[0] = "ROW_COUNTRY"; bindingNameRow[1] = "ROW_CITY"; bindingNameRow[2] = "ROW_SALE_DATE"; bindingNameRow[3] = "ROW_AMOUNT"; IBaseExpression[] bindingExprRow = new IBaseExpression[4]; bindingExprRow[0] = new ScriptExpression( "dataSetRow.COUNTRY" ); bindingExprRow[1] = new ScriptExpression( "dataSetRow.CITY" ); bindingExprRow[2] = new ScriptExpression( "dataSetRow.SALE_DATE" ); bindingExprRow[3] = new ScriptExpression( "dataSetRow.AMOUNT" );  createAndRunQuery(bindingNameGroup, bindingExprGroup, groupDefn, null, null, null, bindingNameFilter, bindingExprFilter,filters,bindingNameRow, bindingExprRow);
	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( );			}