<div dir="ltr">Hello Jeremiah,<div><br></div><div>When you implement a UDF in Mondrian, one of the methods you can implement specifies the type of object returned by the instance. The Javadocs have all the details here:</div>

<div><br></div><div><a href="http://mondrian.pentaho.com/api/mondrian/spi/UserDefinedFunction.html#getReturnType(mondrian.olap.type.Type[])">http://mondrian.pentaho.com/api/mondrian/spi/UserDefinedFunction.html#getReturnType(mondrian.olap.type.Type[])</a><br>

</div><div><br></div><div>It&#39;s worth noting that this method takes a list of parameter types. These are the types that were used when the method was invoked in MDX, so you can return a different type of object according to the arguments which were used in the MDX.</div>

<div><br></div><div>Alternatively, for quick prototyping, you can implement the UDFs in Javascript directly in your schema file. It&#39;s the fast and easy way to try them out, but I strongly advise writing them in Java and writing unit tests and all. We have a lot of unit tests for UDFs in the base test suite, so you can copy/paste some code from there.</div>

<div><br></div><div>Let us know if we can help you further.</div><div><br></div><div>Luc</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 2:32 PM, Johnson, Jeremiah <span dir="ltr">&lt;<a href="mailto:jeremiah.johnson@truvenhealth.com" target="_blank">jeremiah.johnson@truvenhealth.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">I would like to write a UDF that takes in a set and  transforms it into a new set. I think I have figured out how to process sets in a UDF but I’m not sure if Mondrian can handle returning a set from a UDF because the execute() method returns
 an Object. I don’t know what classes are legal. I did look at existing UDFs and nothing is jumping out at me as returning a set. Can I return a set and what class type does it have to be?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a">.....................................................<u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a">Jeremiah Johnson</span></b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a"><br>


</span><b><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#0072ce">Truven Health Analytics<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a">Phone: <a href="tel:734-913-3194" value="+17349133194" target="_blank">734-913-3194</a><u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#25282a">The Healthcare Business of Thomson Reuters is now
<br>
Truven Health Analytics. <u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br></blockquote></div><br></div>