summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2011-11-15 21:51:46 (EST)
committer mwu2011-11-15 21:51:46 (EST)
commitddecf37d56911a421f3b8f271116d1c8f713a7f4 (patch)
treebefc57ddb52befc6785be520c7f5da2e5cca3fca
parentfcada900573bc8d7cb7166337ad10aacde9db903 (diff)
downloadorg.eclipse.birt-ddecf37d56911a421f3b8f271116d1c8f713a7f4.zip
org.eclipse.birt-ddecf37d56911a421f3b8f271116d1c8f713a7f4.tar.gz
org.eclipse.birt-ddecf37d56911a421f3b8f271116d1c8f713a7f4.tar.bz2
Checkin: Project 1371: "Previous Year to date" Calculation Type outputs
no data. [45302]
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java
index 871edf5..c561c1d 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java
@@ -32,23 +32,23 @@ public class PreviousNPeriodsFunction extends AbstractMDX implements IParallelPe
Calendar cal = new GregorianCalendar( TimeMemberUtil.getTimeZone( ),
TimeMemberUtil.getDefaultLocale( ) );
translateToCal( cal, levels, values );
-
+
if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_YEAR ) )
- cal.add( Calendar.YEAR, -offset );
+ cal.add( Calendar.YEAR, offset );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_QUARTER ) )
- cal.add( Calendar.MONTH, -offset * 3 );
+ cal.add( Calendar.MONTH, offset * 3 );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_MONTH ) )
- cal.add( Calendar.MONTH, -offset );
+ cal.add( Calendar.MONTH, offset );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH ) )
- cal.add( Calendar.WEEK_OF_MONTH, -offset );
+ cal.add( Calendar.WEEK_OF_MONTH, offset );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR ) )
- cal.add( Calendar.WEEK_OF_YEAR, -offset );
+ cal.add( Calendar.WEEK_OF_YEAR, offset );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH ) )
- cal.add( Calendar.DAY_OF_MONTH, -offset );
+ cal.add( Calendar.DAY_OF_MONTH, offset );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR ) )
- cal.add( Calendar.DAY_OF_YEAR, -offset );
+ cal.add( Calendar.DAY_OF_YEAR, offset );
else if ( levelName.equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK ) )
- cal.add( Calendar.DAY_OF_WEEK, -offset );
+ cal.add( Calendar.DAY_OF_WEEK, offset );
int[] newValues = getValueFromCal( cal, levels );