<html><DIV><FONT color=#0000ff size=2 face=Verdana>Ok, see attached. This is more about PRD than Mondrian, but since I started in this group and others were interested, I am sending my initial solution.</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>A couple of notes:</FONT></DIV>
<DIV><FONT color=#0000ff size=2>1) A query is used to get a list of distinct product lines: ListProductLines.</FONT></DIV>
<DIV>select '[Product].[All Products].['||productline||']' as productmember<BR>from products<BR>group by productmember</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>2) A parameter&nbsp;multi-select is set up for pulling the query values: pProductLine</FONT></DIV>
<DIV><FONT color=#0000ff size=2>The user can select one or more values to display</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>3) A final parameter variable is set for turning the selected values into an MDX query component: pProductArray</FONT></DIV>
<DIV><FONT color=#0000ff size=2>The trick is the formula - ="{" &amp; CSVTEXT([pProductLine];false(); ",") &amp; "}"</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>This formula comma separates the values and adds the curly braces required for MDX. This can probably be done in a single parameter, but I split it for illustration purposes.</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>That's it. The next step is to provide a dynamic set of columns on the report itself. I am testing with indexed array variables in PRD. This may require some javascripting so that I can assure array members and not get outside the index value.</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>This is nothing fancy at this time. I just needed to get the basics so that I can move onto the next portion, but it does serve as a very basic example of controlled ad hoc reporting with MDX.</FONT></DIV>
<DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff size=2>BR/Bill W. </FONT></DIV>
<BLOCKQUOTE style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"><FONT size=2 face=Tahoma>-----Original Message-----<BR><B>From:</B> Diethard Steiner [mailto:diethard.steiner@gmail.com]<BR><B>Sent:</B> Thursday, July 22, 2010 09:27 AM<BR><B>To:</B> 'Mondrian developer mailing list'<BR><B>Subject:</B> Re: [Mondrian] Parameterized Mondrian Queries in PRD<BR><BR></FONT>Thanks a lot Bill! Much appreciated. 
<DIV>Best regards,</DIV>
<DIV>Diethard<BR><BR>
<DIV class=gmail_quote>On Thu, Jul 22, 2010 at 12:46 PM, Bill Wimsatt <SPAN dir=ltr>&lt;<A href="mailto:waw@1783.com" target=_blank mce_href="mailto:waw@1783.com">waw@1783.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>
<DIV style="WORD-WRAP: break-word">I sure will. I will create a version that uses the SampleData so that anyone can follow it. 
<DIV><BR></DIV>
<DIV><BR>
<DIV><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px"><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px">
<DIV style="WORD-WRAP: break-word"><SPAN style="TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: 12px Helvetica; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px">
<DIV style="WORD-WRAP: break-word">
<DIV>Best Regards</DIV>
<DIV>Bill Wimsatt</DIV>
<DIV>1783 Productions, LLC</DIV>
<DIV>720 318 5550 (c)</DIV>
<DIV><BR></DIV></DIV></SPAN><BR></DIV></SPAN><BR></SPAN><BR></DIV><BR>
<DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV>On Jul 22, 2010, at 2:26 AM, Diethard Steiner wrote:</DIV><BR></DIV></DIV>
<BLOCKQUOTE type="cite">
<DIV>
<DIV></DIV>
<DIV class=h5>Hi Will, 
<DIV>I was following this thread with great interest. I'd appreciate if you could share your solution on how to<SPAN style="BORDER-COLLAPSE: collapse; FONT-FAMILY: arial, sans-serif; FONT-SIZE: 13px">&nbsp;create a dynamic set of columns for your report in PDR.</SPAN></DIV>
<DIV><FONT face="arial, sans-serif"><SPAN style="BORDER-COLLAPSE: collapse"><BR></SPAN></FONT></DIV>
<DIV><FONT face="arial, sans-serif"><SPAN style="BORDER-COLLAPSE: collapse">I also added your example to my PRD parameter guide/reference (</SPAN></FONT><A href="http://diethardsteiner.blogspot.com/2009/11/using-parameters-in-pentaho-report.html" target=_blank mce_href="http://diethardsteiner.blogspot.com/2009/11/using-parameters-in-pentaho-report.html">http://diethardsteiner.blogspot.com/2009/11/using-parameters-in-pentaho-report.html</A>) as I think it will be useful for other users too (I hope this is fine with you).</DIV>
<DIV><BR></DIV>
<DIV>Best regards,</DIV>
<DIV>Diethard</DIV>
<DIV><FONT face="arial, sans-serif"><SPAN style="BORDER-COLLAPSE: collapse"><BR></SPAN></FONT><BR>
<DIV class=gmail_quote>On Wed, Jul 21, 2010 at 11:57 PM, <SPAN dir=ltr>&lt;<A href="mailto:waw@1783.com" target=_blank mce_href="mailto:waw@1783.com">waw@1783.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>Thank you. That is what I needed!<BR><BR>I have changed my query to:<BR><BR>WITH SET [selectedset] AS ${CSVClient}<BR>select [selectedset] ON COLUMNS,<BR>
<DIV>&nbsp;{[Measures].[Count of Employees], [Measures].[Count of Declined], [Measures].[Count No Record], [Measures].[Count Requested But No Vaccination Record], [Measures].[Count Vaccinated], [Measures].[Count Vaccinated Elsewhere], [Measures].[% Vaccinated], [Measures].[% Declined], [Measures].[% No Record]} ON ROWS<BR>from [Monthly Influenza Summary]<BR></DIV>where ([Monthly Period].[${SelectedYear}])<BR><BR>I am using PRD parameters to get the set of customers in a multi-select, then I turn that set into a formatted array which I use in the query. The basics are there now. Now, I need to get PRD to create a dynamic set of columns for my report. I have seen someone using tables as a parameter, so I will get that part figured out.<BR><BR><BR>Bill W.<BR>
<DIV>
<DIV></DIV>
<DIV>-----Original Message-----<BR>From: Thomas Morgner [mailto:<A href="mailto:mondrian@sherito.org" target=_blank mce_href="mailto:mondrian@sherito.org">mondrian@sherito.org</A>]<BR>Sent: Wednesday, July 21, 2010 05:53 AM<BR>To: 'Mondrian developer mailing list'<BR>Subject: Re: [Mondrian] Parameterized Mondrian Queries in PRD<BR><BR>String parameters are passed into Mondrian without any postprocessing by the reporting engine (if the parameter is a java.lang.String, otherwise we will throw a very visible exception). You are using a StrToMember which probably does not like the "{..}" syntax of the sets. Try a StrToSet instead, if you intend to pass a set. You can also skip the parameter function and use the classical ${...} parametrization syntax (PRD 3.6 or newer), which performs a simple replacement on the MDX string. To prevent code injections you can specify a subformat along with those parameters: ${param} will include the parameter without any modification. ${param,string} will quote the parameter value as MDX string (slap double quotes around it and escape all inner double quote chars) ${param,formattype,formatstyle} will treat the parameter as a message format request, so that you can format numbers, dates and so on properly. For the grammar of formattype and formatstyle have a look at <A href="http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/text/MessageFormat.html" target=_blank mce_href="http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/text/MessageFormat.html">http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/text/MessageFormat.html</A> On 20.07.10 15:18, <A href="mailto:waw@1783.com" target=_blank mce_href="mailto:waw@1783.com">waw@1783.com</A> wrote: &gt; After looking through Julian's Jira note and looking through MDX notes a &gt; bit more, I am wondering if the Parameter function is working in PRD. I &gt; have created a parameter query that creates a member string : {[Client &gt; Location].[Clients].[CLIENT1]}. The string is part of the PRD MDX Query &gt; like the following &gt; select strToMember(Parameter("SetofClients", STRING, "[Client &gt; Location].[Clients].[All Clients]"))) ON COLUMNS, &gt; Crossjoin(Hierarchize({[Monthly Period].[2010]}), {[Measures].[Count of &gt; Employees], [Measures].[Count of Declined], [Measures].[Count No &gt; Record], [Measures].[Count Requested But No Vaccination Record], &gt; [Measures].[Count Vaccinated], [Measures].[Count Vaccinated Elsewhere], &gt; [Measures].[% Vaccinated], [Measures].[% Declined], [Measures].[% No &gt; Record]}) ON ROWS &gt; from [Monthly Influenza Summary] &gt; The query works fine when not parameterized. So, looking at Jira and the &gt; forums, I am wondering if I am chasing ghosts. The Advanced OLAP option &gt; in PRD is not well documented, so I am not sure how to build a &gt; completely dynamic MDX query in PRD. Any thoughts or direction is &gt; greatly appreciated. &gt; BR/Bill W. &gt; &gt; &gt; &gt; _______________________________________________ &gt; Mondrian mailing list &gt; <A href="mailto:Mondrian@pentaho.org" target=_blank mce_href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</A> &gt; <A href="http://lists.pentaho.org/mailman/listinfo/mondrian" target=_blank mce_href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A> _______________________________________________ Mondrian mailing list <A href="mailto:Mondrian@pentaho.org" target=_blank mce_href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</A> <A href="http://lists.pentaho.org/mailman/listinfo/mondrian" target=_blank mce_href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR><BR><BR>_______________________________________________<BR>Mondrian mailing list<BR><A href="mailto:Mondrian@pentaho.org" target=_blank mce_href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</A><BR><A href="http://lists.pentaho.org/mailman/listinfo/mondrian" target=_blank mce_href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV>_______________________________________________ 
<DIV class=im><BR>Mondrian mailing list<BR><A href="mailto:Mondrian@pentaho.org" target=_blank mce_href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</A><BR><A href="http://lists.pentaho.org/mailman/listinfo/mondrian" target=_blank mce_href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV><BR>_______________________________________________<BR>Mondrian mailing list<BR><A href="mailto:Mondrian@pentaho.org" target=_blank mce_href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</A><BR><A href="http://lists.pentaho.org/mailman/listinfo/mondrian" target=_blank mce_href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></html>