Knowledgebase: RadarCube ASP.NET MSAS
Creating Calculated Measures and Hierarchy Members with MDX
Posted by - NA - on 22 July 2008 04:28 PM

Starting with the ver. 1.40 RadarCube ASP.NET for MSAS it is possible, even for the end users, to create calculated measures and hierarchy members with MDX expressions through the toolbox and the appropriate items of the context menu.


End User’s Guide

End users are able to create calculated measures either by using the "Create Calculated Measure" icon in the toolbox, or selecting the appropriate item from the context menu of the "Measures" cell in the Level Captions area.


Editing calculated measures is available through the context menu of either the measure name or the data cells from this measure.


To create calculated members, use the appropriate item from the context menu of the Level Caption cell. To edit or remove a calculated member, use the context menu of the cell with its name.



Programmer’s Guide

To create or remove calculated measures, use the TOLAPGrid.Measures.AddCalculatedMeasures and TOLAPGrid.Measures.DeleteCalculatedMeasures methods accordingly. The MDX-formula for calculating the measure must be assigned to its Expression property right after its creation. For example:

 

TMeasure m = TOLAPGrid1.Measures.AddCalculatedMeasure("Calculated");
m.Expression = "[Measures].[Sales Amount] / [Measures].[Order Count]";

 

To create or remove calculated hierarchy members use the THierarchy.CreateCalculatedMember and THierarchy.DeleteCalculatedMember accordingly. The MDX-formula for calculating the member must be assigned to its Expression property right after its creation. For example:

 

THierarchy h = TOLAPGrid1.Dimensions.FindHierarchyByDisplayName("Sales Channel");
TCalculatedMember M = h.CreateCalculatedMember("Reseller - Internet""",
h.Levels[0], null, TCustomMemberPosition.cmpLast);
M.Expression = "[Sales Channel].[Reseller] - [Sales Channel].[Internet]";

 

(602 vote(s))
This article was helpful
This article was not helpful

Help Desk Software by Kayako Resolve