Skip to content

Commit

Permalink
Fix issue Relative time periods are not calculated correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu authored and zhiqiangqian committed Jul 22, 2014
1 parent c5a0385 commit ef801ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -131,7 +131,10 @@ public class TimeFunctionCalculator
}
if( existReferenceDate )
{
endLevelIndex = cubeDimensionReader.getlowestLevelIndex( tDimName ) - 1;
if ( cubeDimensionReader.getlowestLevelIndex( tDimName ) == 0 )
endLevelIndex = 0;
else
endLevelIndex = cubeDimensionReader.getlowestLevelIndex( tDimName ) - 1;
}
else
{
Expand Down
Expand Up @@ -58,8 +58,13 @@ public static TimeMember toMember( IDimension timeDimension, Date referenceDate,
{
ILevel[] levels = timeDimension.getHierarchy( ).getLevels();
String[] levelType = null;
if( referenceDate != null )
levelType = new String[levels.length - 1];
if ( referenceDate != null )
{
if ( levels.length > 1 )
levelType = new String[levels.length - 1];
else
levelType = new String[levels.length];
}
else
{
levelType = new String[getLowestLevelIndex(timeDimension, cellTimeMember)+1];
Expand Down

0 comments on commit ef801ad

Please sign in to comment.