SSAS 2008 R2, strtomember doesn't work

This code works:

CREATE MEMBER CURRENTCUBE.[Measures].[Percent]
 AS 
    [Measures].[Sum]
    /
    ([Companies].[CompList].CurrentMember.Parent
        , [Measures].[Sum]),

But this one doesn't work (why? I cannot to realize... ):

CREATE MEMBER CURRENTCUBE.[Measures].[Percent]
 AS 
    [Measures].[Sum]
    /
    (strtomember('[Companies].[CompList]').CurrentMember.Parent
        , [Measures].[Sum]),

June 25th, 2015 12:26pm

It's not working because that is not a valid member reference.

Member references should be a 3 part name in the form of either:

  [<Dimension>].[<Hierarchy/Attribute>].[<MemberName>]

or

  [<Dimension>].[<Hierarchy/Attribute>].&[<MemberKey>]

The string you are using is ambiguous and the server will not know how to resolve it.

Free Windows Admin Tool Kit Click here and download it now
June 25th, 2015 9:41pm

However this code is not working too:

CREATE MEMBER CURRENTCUBE.[Measures].[Percent]
 AS 
    [Measures].[Sum]
    /
    (strtomember('[Companies].[CompList].CurrentMember').Parent
        , [Measures].[Sum]),



CREATE MEMBER CURRENTCUBE.[Measures].[Percent]
 AS 
    [Measures].[Sum]
    /
    (strtomember('[Companies].[CompList].CurrentMember.Parent')
        , [Measures].[Sum]),

I'm just trying to calculate percent by rows regardless of the data in those rows. Is there a correct way to do this?

June 26th, 2015 2:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics