[Mondrian] First Day of Week - CurrentDateMember

Diethard Steiner diethard.steiner at gmail.com
Wed Nov 26 05:11:23 EST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20141126/96b5fc4d/attachment.html 


More information about the Mondrian mailing list