public static void addData ( final Crosstab < Number > mainCrosstab , final Crosstab < Number > partialCrosstab , final CrosstabDimension columnDimension , final CrosstabDimension measureDimension ) { if ( partialCrosstab != null ) { final CrosstabNavigator < Number > mainNavigator = new CrosstabNavigator <> ( mainCrosstab ) ; final CrosstabNavigator < Number > nav = new CrosstabNavigator <> ( partialCrosstab ) ; for ( final String columnCategory : columnDimension . getCategories ( ) ) { // just navigate through the dimensions because is the column // dimension nav . where ( columnDimension , columnCategory ) ; mainNavigator . where ( columnDimension , columnCategory ) ; // navigate and sum up data final List < String > categories = measureDimension . getCategories ( ) ; for ( final String measureCategory : categories ) { sumUpData ( mainNavigator , nav , measureDimension , measureCategory ) ; } } } }
Add the values of partial crosstab to the main crosstab