Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

LEAVES function causing problems in MDX Script

$
0
0

Hello,

Got a bit of a weird situation here and I'm having trouble fathoming it.

I have a cube with a dimension called [Currency]. I have a MDX Script which contains the function call:

LEAVES([Currency])

And up until this afternoon everything was getting processed fine. Since then I introduced a new measure group that does not include [Currency] and still everything is getting processed fine.

I then added another measure group that, again, does not include [Currency]. I am now getting a processing error on my second new measure group:

Leaves function for attributes with mixed granularity in different measure groups is not supported.

I think I can kinda work out why I'm getting the error - its because the LEAVES function references members that are not in the measure group. What I don't understand is why it didn't fail after only adding the first new measure group because surely this exhibits the same problems as the second one (i.e. [Currency] isn't in it).

Can anyone explain this?

Incidentally, if I add [Currency] to these 2 measure groups against a dummy member then everything works fine - but that's probably not surprising!

Thanks in advance for any help/advice/questions/answers!

-Jamie

 

P.S. In case anyone is bothered, here's the calculation:

Scope

( EXCEPT( Measures.MEMBERS, {[Measures].[Rate]} ));

Scope(Leaves([Currency]), EXCEPT( [Currency Conversion].[Currency Conversion].MEMBERS, {[Currency Conversion].[Currency Conversion].&[<None>]} ));

This = iif(isempty(Measures.[Rate]) orisempty([Currency Conversion].[<None>]) or Measures.[Rate] = 0 or [Currency Conversion].[<None>] = 0,

null,

[Currency Conversion].[<None>] / Measures.[Rate]);

EndScope;

End

Scope;

 


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>