[Mondrian] First Day of Week - CurrentDateMember

Julian Hyde julianhyde at gmail.com
Thu Nov 27 16:47:40 EST 2014


I added a lot of locale-specific stuff (e.g. currency) to mondrian.util.Format.FormatLocale.

It gleans as much as it can from the java.util.Locale. IIRC there is also a way of putting the information in a locale resource file.

It wouldn’t be that hard to add first-day-of-week to FormatLocale. Then I believe CurrentDateMember would inherit it (because it uses Format under the covers).

Julian



> On Nov 26, 2014, at 2:11 AM, Diethard Steiner <diethard.steiner at gmail.com> wrote:
> 
> Hi,
> 
> As far as I understood the formatting string for CurrentDateMember is based on the Visual Basic Syntax. This one seems to only provide one formatting option for day of week, and this one is based on a week starting on a Sunday. Over here in Europe, the week starts on a Monday, in other parts of the world on Thursday and so on. This has an impact on how you use in example the Lag() function. In example:
> 
> SELECT
>     [Measures].[Count Subscribers] ON 0
>     , NON EMPTY( ( CurrentDateMember([Activation Date.Weekly Calendar],"[""Activation Date.Weekly Calendar""]\.[yyyy]\.[ww]\.[w]").Lag(21) : CurrentDateMember([Activation Date.Weekly Calendar],"[""Activation Date.Weekly Calendar""]\.[yyyy]\.[ww]\.[w]").Lag(2)) ON 1
> FROM [Subscriber]
> 
> Today is Wednesday, the third day of week according to the European standard, however the format string in the query above will return 4 because it is based on the US standard. Hence to get data up to yesterday, I have to use Lag(2) instead of Lag(1). Now this is not a massive problem, but not ideal either. I wonder if there is a global Mondrian setting which allows to define the start of the week (maybe something similar as outlined here: http://msdn.microsoft.com/en-us/library/20ee97hz(v=vs.90).aspx) <http://msdn.microsoft.com/en-us/library/20ee97hz(v=vs.90).aspx)>, so that the formatting string result is based on this.
> 
> Best regards,
> Diethard
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20141127/3b185150/attachment.html 


More information about the Mondrian mailing list