=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java' --- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java 2015-04-09 20:49:51 +0000 +++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java 2015-04-10 08:32:41 +0000 @@ -412,6 +412,22 @@ } /** + * Removes the dimensions with the given identifiers. + */ + public DataQueryParams removeDimensions( String... dimension ) + { + if ( dimension != null ) + { + for ( String dim : dimension ) + { + this.dimensions.remove( new BaseDimensionalObject( dim ) ); + } + } + + return this; + } + + /** * Removes the dimension or filter with the given identifier. */ public DataQueryParams removeDimensionOrFilter( String dimension ) === modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java' --- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-04-09 20:49:51 +0000 +++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java 2015-04-10 08:32:41 +0000 @@ -1243,9 +1243,7 @@ */ private DataQueryParams getQueryIndicatorsReplacedByDataElements( DataQueryParams params, int indicatorIndex ) { - DataQueryParams dataSourceParams = params.instance(); - dataSourceParams.removeDimension( DATAELEMENT_DIM_ID ); - dataSourceParams.removeDimension( DATASET_DIM_ID ); + DataQueryParams dataSourceParams = params.instance().removeDimensions( DATAELEMENT_DIM_ID, DATASET_DIM_ID ); List indicators = asTypedList( dataSourceParams.getIndicators() ); List dataElements = asList( expressionService.getDataElementsInIndicators( indicators ) ); === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-04-08 23:26:45 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2015-04-10 08:32:41 +0000 @@ -851,6 +851,12 @@ executeSql( "update relativeperiods set thisquarter = false where thisquarter is null" ); executeSql( "update relativeperiods set thissixmonth = false where thissixmonth is null" ); executeSql( "update relativeperiods set thisweek = false where thisweek is null" ); + + executeSql( "update relativeperiods set lastmonth = false where lastmonth is null" ); + executeSql( "update relativeperiods set lastbimonth = false where lastbimonth is null" ); + executeSql( "update relativeperiods set lastquarter = false where lastquarter is null" ); + executeSql( "update relativeperiods set lastsixmonth = false where lastsixmonth is null" ); + executeSql( "update relativeperiods set lastweek = false where lastweek is null" ); } private void upgradeDataValuesWithAttributeOptionCombo()