【问题标题】:How to tuple with Member_Key MDX SSAS?如何使用 Member_Key MDX SSAS 进行元组?
【发布时间】:2020-04-08 06:17:44
【问题描述】:

我想使用 [Dim].[Country] 的成员键进行元组处理

{[Dim].[Country].CurrentMember.Member_Key},
STRTOSET("[User].[ID].&[" + mid(username, instr(username, "\")+1) + "]")

但是当我使用 CurrentMember.Member_Key 函数时,我收到以下错误: 该函数需要一个用于 1 参数的元组集表达式。使用了字符串或数字表达式。

如果我这样写的话,使用“成员”是可行的。但随后它将使用全名(100 - 挪威)进行元组,但我的目标是仅使用关键部分进行元组,例如“100”

{[Dim].[Country].members},
STRTOSET("[User].[ID].&[" + mid(username, instr(username, "\")+1) + "]")

最好的问候, 红宝石

【问题讨论】:

    标签: ssas mdx olap cube


    【解决方案1】:

    你应该这样做,而不是 [Dim].[Country].CurrentMember.Member_Key:

    with member [Measures].CountryKey as [Dim].[Country].CurrentMember.Member_Key
    

    所以这样的事情可能会起作用(在 Adventure Works 上):

    with member [Measures].CountryKey as [Geography].[Country].CurrentMember.Member_Key
    SELECT ([Measures].CountryKey, StrToSet ('[Geography].[State-Province].Members')  )
    ON 0  
    FROM [Adventure Works] 
    

    【讨论】:

    • 这是在 Visual Studios 中的 OLAP 多维数据集中的“数据维度”选项卡中的角色,所以我不太确定如何创建 [Measures].CountryKey。请参阅此博文:bifuture.blogspot.com/2011/09/…
    • 我在博客中创建了一个示例,该示例非常适用于我的维度属性之一 [国家代码],因为在安全表中使用的列是 [国家代码]。问题是我在同一维度中也有一个属性,我希望将相同的安全应用于但此属性是 [Country Code_Description],它与安全表不匹配。我为 [Country Code_Description] 所做的是将 KeyColumn 设置为 [Country Code],以便我可以使用 Member_Key。
    • 但是这个语句不起作用。 {[Dim].[Country].CurrentMember.Member_Key}, STRTOSET("[User].[ID].&[" + mid(username, instr(username, "\")+1) + "]")
    • 我的第一个想法是我必须从 [Country Code_Description] 中对描述部分进行子串化,这就是我发布的原因:“如何删除 OLAP 维度成员的第一个空格后的所有字符”
    猜你喜欢
    • 2012-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多