简体   繁体   中英

Aggregating Hierarchies with SCOPE MDX

I have have a requirement in SSAS cube to apply different set of calculations at different levels in hierarchy and also at the ALL member level of each of the hierarchy level. I am using Scope assignment and successful in doing it at Leaf level but the All level I can't scope on since there is a hierarchy with 4 levels and each level has separate rule in addition to the the ALL levels for each of the four. The reason why I don't scope on all is clarified in this post http://www.purplefrogsystems.com/blog/2009/11/scope-problems-with-mdx-calculated-members

My scope statement looks like this

SCOPE(DESCENDANTS([Commodity].[Category],,AFTER));
THIS = /*Calculation logic*/                   
END SCOPE;


SCOPE(DESCENDANTS([Commodity].[SubCategory],,AFTER));
THIS = /*Calculation logic*/                   
END SCOPE;

SCOPE(DESCENDANTS([Commodity].[Product],,AFTER));
THIS = /*Calculation logic*/                   
END SCOPE;

Any help much appreciated.

It's a very old post but I was trying so solve this too. FREEZE; seems to do the trick

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM