← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17321: Analytics, fix for text type data elements

 

------------------------------------------------------------
revno: 17321
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-10-31 10:56:55 -0400
message:
  Analytics, fix for text type data elements
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2014-10-16 06:17:19 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2014-10-31 14:56:55 +0000
@@ -271,7 +271,8 @@
     
     /**
      * Generates the from clause of the SQL query. This method should be used for
-     * queries where the period filter spans multiple partitions.
+     * queries where the period filter spans multiple partitions. This query
+     * will return a result set which will be aggregated by the outer query.
      */
     private String getFromWhereClauseMultiplePartitionFilters( DataQueryParams params )
     {
@@ -280,8 +281,12 @@
         for ( String partition : params.getPartitions().getPartitions() )
         {
             sql += "select " + getCommaDelimitedQuotedColumns( params.getQueryDimensions() ) + ", ";
-            
-            if ( params.isAggregationType( AVERAGE_SUM_INT ) )
+
+            if ( params.isDataType( TEXT ) )
+            {
+                sql += "textvalue";
+            }
+            else if ( params.isAggregationType( AVERAGE_SUM_INT ) )
             {
                 sql += "daysxvalue";
             }