<br>Spofford' s MDX Solutions book says that you disambiguate the conflicting function names using the classID of the library it is defined in. An example he gives is:<br><br> 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, <<a href="mailto:timothy.lambert@thomsonreuters.com">timothy.lambert@thomsonreuters.com</a>> 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. 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't realize that VBA is a package name and the ! is a separator, I also don't know whether or not they can be multi-leveled. But I'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: 'Mondrian developer mailing list'<br>
Subject: RE: [Mondrian] Cognos 8.3 & "VBA!" 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. 'Foo!Bar!MyFun()')? Does it allow<br>
spaces (e.g. 'VBA ! Len("foo")).<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>
public FunDef getDef(<br>
Exp[] args,<br>
Validator validator,<br>
List<String> funNames,<br>
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>
> -----Original Message-----<br>
> From: <a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a><br>
> [mailto:<a href="mailto:mondrian-bounces@pentaho.org">mondrian-bounces@pentaho.org</a>] On Behalf Of<br>
> <a href="mailto:timothy.lambert@thomsonreuters.com">timothy.lambert@thomsonreuters.com</a><br>
> Sent: Wednesday, April 23, 2008 3:33 PM<br>
> To: <a href="mailto:mondrian@pentaho.org">mondrian@pentaho.org</a><br>
> Subject: [Mondrian] Cognos 8.3 & "VBA!" Functions<br>
><br>
> Cognos 8.3 generates MDX VBA functions prefixed with "VBA!";<br>
> e.g. VBA!LEN(<string>). The signatures and semantics of the<br>
> functions are the same.<br>
><br>
> I've investigated a number of ways to enhance Mondrian to<br>
> support this prefix.<br>
><br>
> With all these following solutions, the Mondrian lexical<br>
> analyzer needs to be enhanced to support an identifier token<br>
> that contains a '!'. This is trivial since the grammar does<br>
> not specify the use of '!'. Specifically, at line 640 in<br>
> Scanner.java#21, add " case '!':<br>
><br>
> After this is done, one of the following can be done...<br>
><br>
> 1) At the scanner level strip "VBA!" from identifiers.<br>
><br>
> 2) When functions are being resolved during parser reduction<br>
> action processing, strip "VBA!" from the function name being resolved.<br>
><br>
> 3) Some variation of 1 or 2 in which an alias map is used<br>
> instead of just handling "VBA!".<br>
><br>
> 4) In the Vba class, make a new method for each VBA! alias.<br>
> Each new method would delegate to its non-VBA! counterpart.<br>
><br>
> 5) Enhance FunDef and Resolver to support the notion of aliases.<br>
><br>
> ----<br>
><br>
> While 1 and 2 are really quick to implement, I view them as<br>
> hacks. Hacks because they are disjoint from the code that<br>
> sets up function definitions, and does not fit well within<br>
> the OO design of the rest of the system.<br>
><br>
> I view 3 as only slightly better. Depending on how the map<br>
> is constructed it may have the same design flaw as 1 and 2.<br>
><br>
> The forth option is also easy and pretty clean. The only<br>
> problem is that it only handles the VBA! problem. Other<br>
> functions are setup differently and would require a different<br>
> (albeit similar) approach. Furthermore it's very verbose.<br>
><br>
> I would like to promote some variation of 5. The question is<br>
> how to best incorporate general alias information into the<br>
> rest of the processing.<br>
><br>
> One idea that I was playing with is to create a Resolver<br>
> decorator/wrapper that exposes the aliased name but delegates<br>
> to the same Resolver instance setup for the "normally" named FunDef.<br>
><br>
> There would be a bit of code that processes the aliases and<br>
> adds Resolver instances to the map that is part of FunTableImpl.<br>
><br>
> Once that map is setup, the rest of the code should operate as is.<br>
><br>
> Feedback appreciated.<br>
><br>
> - Tim<br>
><br>
><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>
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>