[Mondrian] periodstodate with non-Time dimensions

John V. Sichi jsichi at gmail.com
Wed Sep 17 22:18:39 EDT 2008


PeriodsToDateFunDef.getResultType is currently insisting on a time
dimension even when a level is specified:

         if (type.getDimension() == null ||
             type.getDimension().getDimensionType() !=
                 mondrian.olap.DimensionType.TimeDimension) {
             throw MondrianResource.instance().TimeArgNeeded.ex(getName());
         }

The MSFT docs say "Returns a set of sibling members from the same level 
  as a given member, starting with the first sibling and ending with the 
  given member, as constrained by a specified level in the Time  dimension."

http://msdn.microsoft.com/en-us/library/ms144925.aspx

But this article mentions that non-time dimensions can be used:

http://www.databasejournal.com/features/mssql/article.php/3073581

So I'm thinking the check above may be incorrect (I haven't tried MSAS yet).

This comes up for us when a schema contains both fiscal and non-fiscal 
calendar dimensions; we don't declare the fiscal ones as type Time.

In passing, in this section:

http://mondrian.pentaho.org/documentation/schema.php#Time_dimensions

The table does not list TimeWeeks as an allowable levelType, but 
TimeWeeks is used as a levelType in the example.

JVS





More information about the Mondrian mailing list