<br>Spofford&#39; s MDX Solutions book says that you disambiguate the conflicting function names using the classID of the library it is defined in.&nbsp; An example he gives is:<br><br>&nbsp; EFStatsPackage!FunctionClass!PctDiff([time],[time].prevMember)<br>
<br>So it appears you <i>can</i> have multi-level qualification.<br><br>Also, I ran a quick test in SSAS2005 and spaces are permitted on either side of the !.<br><br><br><div class="gmail_quote">On Wed, Apr 23, 2008 at 9:23 PM,  &lt;<a href="mailto:timothy.lambert@thomsonreuters.com">timothy.lambert@thomsonreuters.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">The way I understood the problem was that VBA!FOO was an alias for FOO. &nbsp;Not that VBA was a package name qualification of the function.<br>

<br>
Looking at things as a package name qualifier issue completely changes things - I retract everything I said in my original email. :)<br>
<br>
Since I didn&#39;t realize that VBA is a package name and the ! is a separator, I also don&#39;t know whether or not they can be multi-leveled. &nbsp;But I&#39;ll try to find out and open the bug.<br>
<br>
Thanks.<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a> on behalf of Julian Hyde<br>
Sent: Wed 4/23/2008 8:07 PM<br>
To: &#39;Mondrian developer mailing list&#39;<br>
Subject: RE: [Mondrian] Cognos 8.3 &amp; &quot;VBA!&quot; Functions<br>
<br>
For tracking purposes, can you please log a bug for this.<br>
<br>
How general does MDX syntax allow package names to be? Does it allow<br>
multiple levels of qualification (e.g. &#39;Foo!Bar!MyFun()&#39;)? Does it allow<br>
spaces (e.g. &#39;VBA ! Len(&quot;foo&quot;)).<br>
<br>
We should change the scanner to handle the most general case. I think that<br>
will mean that a function is a list of names rather than the current single<br>
name. Then FunTable.getDef() will become<br>
<br>
 &nbsp; &nbsp;public FunDef getDef(<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Exp[] args,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Validator validator,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;List&lt;String&gt; funNames,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Syntax syntax)<br>
<br>
Initially we can change getDef to ignore all but the last member of the name<br>
list, that is, assume that functions are globally unique.<br>
<br>
Julian<br>
<br>
<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a><br>
&gt; [mailto:<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>] On Behalf Of<br>
&gt; <a href="mailto:timothy.lambert@thomsonreuters.com">timothy.lambert@thomsonreuters.com</a><br>
&gt; Sent: Wednesday, April 23, 2008 3:33 PM<br>
&gt; To: <a href="mailto:mondrian@pentaho.org">mondrian@pentaho.org</a><br>
&gt; Subject: [Mondrian] Cognos 8.3 &amp; &quot;VBA!&quot; Functions<br>
&gt;<br>
&gt; Cognos 8.3 generates MDX VBA functions prefixed with &quot;VBA!&quot;;<br>
&gt; e.g. VBA!LEN(&lt;string&gt;). &nbsp;The signatures and semantics of the<br>
&gt; functions are the same.<br>
&gt;<br>
&gt; I&#39;ve investigated a number of ways to enhance Mondrian to<br>
&gt; support this prefix.<br>
&gt;<br>
&gt; With all these following solutions, the Mondrian lexical<br>
&gt; analyzer needs to be enhanced to support an identifier token<br>
&gt; that contains a &#39;!&#39;. &nbsp;This is trivial since the grammar does<br>
&gt; not specify the use of &#39;!&#39;. &nbsp;Specifically, at line 640 in<br>
&gt; Scanner.java#21, add &quot; case &#39;!&#39;:<br>
&gt;<br>
&gt; After this is done, one of the following can be done...<br>
&gt;<br>
&gt; 1) At the scanner level strip &quot;VBA!&quot; from identifiers.<br>
&gt;<br>
&gt; 2) When functions are being resolved during parser reduction<br>
&gt; action processing, strip &quot;VBA!&quot; from the function name being resolved.<br>
&gt;<br>
&gt; 3) Some variation of 1 or 2 in which an alias map is used<br>
&gt; instead of just handling &quot;VBA!&quot;.<br>
&gt;<br>
&gt; 4) In the Vba class, make a new method for each VBA! alias.<br>
&gt; Each new method would delegate to its non-VBA! counterpart.<br>
&gt;<br>
&gt; 5) Enhance FunDef and Resolver to support the notion of aliases.<br>
&gt;<br>
&gt; ----<br>
&gt;<br>
&gt; While 1 and 2 are really quick to implement, I view them as<br>
&gt; hacks. &nbsp;Hacks because they are disjoint from the code that<br>
&gt; sets up function definitions, and does not fit well within<br>
&gt; the OO design of the rest of the system.<br>
&gt;<br>
&gt; I view 3 as only slightly better. &nbsp;Depending on how the map<br>
&gt; is constructed it may have the same design flaw as 1 and 2.<br>
&gt;<br>
&gt; The forth option is also easy and pretty clean. &nbsp;The only<br>
&gt; problem is that it only handles the VBA! problem. &nbsp;Other<br>
&gt; functions are setup differently and would require a different<br>
&gt; (albeit similar) approach. &nbsp;Furthermore it&#39;s very verbose.<br>
&gt;<br>
&gt; I would like to promote some variation of 5. &nbsp;The question is<br>
&gt; how to best incorporate general alias information into the<br>
&gt; rest of the processing.<br>
&gt;<br>
&gt; One idea that I was playing with is to create a Resolver<br>
&gt; decorator/wrapper that exposes the aliased name but delegates<br>
&gt; to the same Resolver instance setup for the &quot;normally&quot; named FunDef.<br>
&gt;<br>
&gt; There would be a bit of code that processes the aliases and<br>
&gt; adds Resolver instances to the map that is part of FunTableImpl.<br>
&gt;<br>
&gt; Once that map is setup, the rest of the code should operate as is.<br>
&gt;<br>
&gt; Feedback appreciated.<br>
&gt;<br>
&gt; - Tim<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Mondrian mailing list<br>
&gt; <a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
&gt; <a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
&gt;<br>
<br>
<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>
<br>
<br>
<br>
<br>
</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>