<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I had a quick look at this<div><br></div><div>a) for format FORMAT_DD and FORMAT_DDD you use the FormatData - days of week etc. coming from&nbsp;sun.text.resources.FormatData - which could be passed via resource file afaik somehow, dont fully understand how but still.</div><div><br></div><div>b) The issue is that all other date formats - in this case FORMAT_W and FORMAT_WW - uses DateFormat in FormatLocale</div><div>But in fact the CurrentDateMemberUdf calls format(Date,..) which goes via BasicFormat, which doesn’t respect the Locale</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Monaco;">Calendar calendar = Calendar.getInstance(); <span style="color: #4e9072">// </span><span style="text-decoration: underline ; color: #4e9072">todo</span><span style="color: #4e9072">: use locale</span></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><span style="color: #4e9072"><br></span></div><div style="margin: 0px;">As the TODO says already, it doesn’t respect the locale, which would be a start (FormatLocale is set properly for mondrian in Diethards case)</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">We could just extend DateFormat to respect the Locale</div><div style="margin: 0px;">Calendar.getInstance(locale.locale)</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">I think this would be better than adding this to the BasicFormat itself - as its supposed to be very basic as I understand it.</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">However, since CurrentDateMember is a heavily used function, it would probably break a lot of existing MDX if we would suddenly respect the locale properly for dates.</div><div style="margin: 0px;">Can you think of a less intrusive approach that would make options like that configurable?</div><div style="margin: 0px;">General Calendar locale and even if you use the right locale, still make firstDayOfWeek etc. options to configure?</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">-Paul</div><div style="margin: 0px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Monaco;"><br></div><div><div>On 27 Nov 2014, at 22:47, Julian Hyde &lt;<a href="mailto:julianhyde@gmail.com">julianhyde@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I added a lot of locale-specific stuff (e.g. currency) to mondrian.util.Format.FormatLocale.<div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">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).</div><div class=""><br class=""></div><div class="">Julian</div><div class=""><br class=""><div class=""><br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 26, 2014, at 2:11 AM, Diethard Steiner &lt;<a href="mailto:diethard.steiner@gmail.com" class="">diethard.steiner@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">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:</div><div class=""><br class=""></div><div class=""><div class="">SELECT</div><div class="">&nbsp; &nbsp; [Measures].[Count Subscribers] ON 0</div><div class="">&nbsp; &nbsp; , 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</div><div class="">FROM [Subscriber]</div></div><div class=""><br class=""></div><div class="">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: <a href="http://msdn.microsoft.com/en-us/library/20ee97hz(v=vs.90).aspx)" class="">http://msdn.microsoft.com/en-us/library/20ee97hz(v=vs.90).aspx)</a>, so that the formatting string result is based on this.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Diethard</div></div>_______________________________________________<br class="">Mondrian mailing list<br class=""><a href="mailto:Mondrian@pentaho.org" class="">Mondrian@pentaho.org</a><br class=""><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br class=""></div></blockquote></div><br class=""></div></div></div></div>_______________________________________________<br>Mondrian mailing list<br><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>http://lists.pentaho.org/mailman/listinfo/mondrian<br></blockquote></div><br></div></body></html>