cube-script

Calculated Members with multiple Attribute Hierarchy - MDX

瘦欲@ 提交于 2019-12-25 03:27:13
问题 I found this little code where it dynamically calculates TOTAL s for all Dimension/Hierarchy I want. This is close to what I need but will not work for Dimensions that have different number of Hierarchy Levels (Attribute Hierarchy). Current Code only works if there is only one Attribute Hierarchy because of CurrentMember.Parent . I could use CurrentMember.Parent.Parent for Dimension.Hierarchy that have two levels and so on but would not work for the the ones with only one Attribute Hierarchy

Calculated Member for the TOTAL of a measure for multiple Dimensions

邮差的信 提交于 2019-12-11 03:51:53
问题 I am trying to TOTAL a measure with a calculated measure AS CALCULATE; CREATE MEMBER CURRENTCUBE.[Measures].[Total On Hand Amount] AS ([Warehouses].[Warehouses].[All],[Measures].[On Hand Amount]), FORMAT_STRING = "#,#", VISIBLE = 1; This is working when I have warehouse Dimension selected but I want to make it dynamic so that it would work for any other dimensions/hierarchies as well without them being added to the code. Any help is appreciated!! 回答1: I think you want to use Root CALCULATE;