<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: [Mondrian] CurrentDateMember</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6001.18099" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=991342516-02102008><FONT face=Verdana
color=#000080 size=2>Looks like a bug in mondrian.util.Format, which implements
VB format strings. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=991342516-02102008><FONT face=Verdana
color=#000080 size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=991342516-02102008><FONT face=Verdana
color=#000080 size=2> static final Token[] tokens =
{<BR> ...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=991342516-02102008><FONT face=Verdana
color=#000080 size=2>
nfe(FORMAT_MMM_LOWER
, DATE, "mmm", null, "Display the month as an abbreviation (Jan -
Dec)."),<BR>
nfe(FORMAT_MMMM_LOWER ,
DATE, "mmmm", null, "Display the month as a full month name (January -
December)."),<BR>
nfe(FORMAT_MMM_UPPER
, DATE, "mmm", null, "Display the month as an abbreviation (Jan -
Dec)."),<BR>
nfe(FORMAT_MMMM_UPPER ,
DATE, "mmmm", null, "Display the month as a full month name (January -
December)."),<BR></FONT></SPAN></DIV>
<DIV><FONT face=Verdana color=#000080 size=2></FONT> </DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080 size=2>Note
that FORMAT_MMM_UPPER's token is "mmm", should be "MMM".</FONT></SPAN></DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080 size=2>So
"MMM" would have been just ignored, as you noticed. I guess "mmm" generated
"Jan", and mondrian resolved it to "JAN" because member name resolution is
case-insensitive.</FONT></SPAN></DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080 size=2>I'll
fix it very shortly.</FONT></SPAN></DIV>
<DIV><SPAN class=991342516-02102008></SPAN> </DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080
size=2>Julian</FONT></SPAN></DIV>
<DIV><SPAN class=991342516-02102008><FONT face=Verdana color=#000080
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Verdana color=#000080 size=2></FONT><FONT face=Verdana
color=#000080 size=2></FONT><FONT face=Verdana color=#000080 size=2></FONT><FONT
face=Verdana color=#000080 size=2></FONT><BR> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Shaffner Joshua
[mailto:joshua.shaffner@goodwill.org] <BR><B>Sent:</B> Thursday, October 02,
2008 9:03 AM<BR><B>To:</B> jhyde@pentaho.com; Mondrian developer mailing
list<BR><B>Subject:</B> Re: [Mondrian] CurrentDateMember<BR></FONT><BR></DIV>
<DIV></DIV><FONT face="Calibri, Verdana, Helvetica, Arial"><SPAN
style="FONT-SIZE: 11pt">In db, I have 1 thru 12 for months. Using jpivot w/o
CurrentDateMember with drilldown to month level would generate something like
this: [Time].[All Times].[2006].[May].<BR><BR>Per VB reference, <A
href="http://www.apostate.com/vb-format-syntax">http://www.apostate.com/vb-format-syntax</A>,
where it shows MMM to display the month as abbrev (Jan – Dec), I tried MMM and
got no results. Using mmm however got me the results. It was an accident that
I typed in mmm and got the results. LoL. <BR><BR>Does it mean that the
Mondarian is expecting mmm, not MMM? <BR><BR>As for using dimension names, I
did try the following but it did not work unless I remove dimension
name.<BR><BR>No results pulled:<BR>{(CurrentDateMember([Time],
"['Time']\.[yyyy]\.[mmm]").Lag(13.0) : CurrentDateMember([Time],
"['Time']\.[yyyy]\.[mmm]").Lag(1.0))} ON ROWS<BR><BR>Results
pulled:<BR>{(CurrentDateMember([Time], "[yyyy]\.[mmm]").Lag(13.0) :
CurrentDateMember([Time], "[yyyy]\.[mmm]").Lag(1.0))} ON ROWS <BR><BR>PS: Am
using biserver_ce 2.0.x<BR><BR>On 10/1/08 7:53 PM, "Julian Hyde" <<A
href="jhyde@pentaho.com">jhyde@pentaho.com</A>>
wrote:<BR><BR></SPAN></FONT>
<BLOCKQUOTE><SPAN style="FONT-SIZE: 11pt"><FONT color=#000080><FONT
face="Verdana, Helvetica, Arial">I think the example had extra '\'s because
it was taken from Java code (inside java strings, " and \ need to be
escaped). That's why it worked for you to change '\\.' to
'\.'.<BR></FONT></FONT><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR></FONT><FONT
color=#000080><FONT face="Verdana, Helvetica, Arial">If you had changed
'\"Time\"' to '"Time"' it would probably have worked too. It worked without
Time because dimension names are optional - although I recommend using
dimension names, because it makes your code clearer and reduces the amount
of searching mondrian has to do.<BR></FONT></FONT><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR></FONT><FONT
color=#000080><FONT face="Verdana, Helvetica, Arial">I also see that you
changed MMM to mmm. I'm guessing that in your dimension months look like
'jan' rather than 'JAN'.<BR></FONT></FONT><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR></FONT><FONT
color=#000080><FONT face="Verdana, Helvetica, Arial">Thanks for letting us
know what works.<BR></FONT></FONT><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR></FONT><FONT
color=#000080><FONT
face="Verdana, Helvetica, Arial">Julian<BR></FONT></FONT><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR></FONT></SPAN>
<BLOCKQUOTE><SPAN style="FONT-SIZE: 11pt"><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR> <BR>
<HR align=center width="100%" SIZE=3>
</FONT><FONT face="Tahoma, Verdana, Helvetica, Arial"><B>From:</B> <A
href="mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</A>
[<A
href="mailto:mondrian-bounces@pentaho.org">mailto:mondrian-bounces@pentaho.org</A>]
<B>On Behalf Of </B>Shaffner Joshua<BR><B>Sent:</B> Wednesday,
October 01, 2008 3:29 PM<BR><B>To:</B> Mondrian developer mailing
list<BR><B>Subject:</B> Re: [Mondrian]
CurrentDateMember<BR></FONT><FONT
face="Calibri, Verdana, Helvetica, Arial"><BR> <BR>Finally got this
working..<BR><BR>Interesting that it works without
[\”Time\”]?<BR><BR>CurrentDateMember([Time],
'[yyyy]\.[mmm]').Lag(12) :<BR>CurrentDateMember([Time],
'[yyyy]\.[mmm]')<BR><BR><BR>On 10/1/08 6:16 PM, "Joshua Shaffner"
<<A
href="joshua.shaffner@goodwill.org">joshua.shaffner@goodwill.org</A>>
wrote:<BR><BR> <BR></FONT></SPAN>
<BLOCKQUOTE><SPAN style="FONT-SIZE: 11pt"><FONT
face="Calibri, Verdana, Helvetica, Arial">Per a couple suggestions in
IRC as well as Julian’s blog ( <A
href="http://julianhyde.blogspot.com/2006/10/mondrian-22-cube-designer-and.html">http://julianhyde.blogspot.com/2006/10/mondrian-22-cube-designer-and.html</A>),
I tried the query below but to no luck. I either get no results or
internal error. If you see something, let me know. I am
stumped...after trying this and that for a couple hours over just
a couple of lines.<BR><BR>SELECT NON EMPTY {[Measures].[Retail
Store Sales], <truncated>} ON COLUMNS,<BR><BR>NON EMPTY
<BR>{<BR>CurrentDateMember([Time],
'[\"Time\"]\\.[yyyy]\\.[MMM]').Lag(12)
:<BR>CurrentDateMember([Time],
'[\"Time\"]\\.[yyyy]\\.[MMM]')<BR>}<BR>ON ROWS<BR><BR>from
[MRSDS]<BR>where [Organization].[All
Organizations].[<truncated>]<BR><BR><BR>PS: I have Time
Hierarchy with two levels, year and month.<BR><BR> <BR>
<HR align=center width="95%" SIZE=3>
</FONT></SPAN><FONT size=2><FONT
face="Consolas, Courier New, Courier"><SPAN
style="FONT-SIZE: 10pt">_______________________________________________<BR>Mondrian
mailing list<BR><A
href="Mondrian@pentaho.org">Mondrian@pentaho.org</A><BR><A
href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR></SPAN></FONT></FONT></BLOCKQUOTE></BLOCKQUOTE><FONT
face="Calibri, Verdana, Helvetica, Arial"><SPAN style="FONT-SIZE: 11pt"><BR>
<HR align=center width="95%" SIZE=3>
</SPAN></FONT><FONT size=2><FONT face="Consolas, Courier New, Courier"><SPAN
style="FONT-SIZE: 10pt">_______________________________________________<BR>Mondrian
mailing list<BR><A
href="Mondrian@pentaho.org">Mondrian@pentaho.org</A><BR><A
href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR></SPAN></FONT></FONT></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>