<HTML>
<HEAD>
<TITLE>Re: [Mondrian] CurrentDateMember</TITLE>
</HEAD>
<BODY>
<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 SIZE="3" WIDTH="100%"> </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 SIZE="3" WIDTH="95%"> </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 SIZE="3" WIDTH="95%"></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>
</BODY>
</HTML>