如何在 MDX 查询中返回级别属性值?

发布于 2024-07-20 05:10:12 字数 527 浏览 4 评论 0原文

我在包含多个级别的架构文件中定义了一个维度。 我的级别之一包含多个属性,例如:

<Level name="MyLevel" column="MyLevelColumn" nameColumn="MyLevelName">
    <Property name="Property1" column="PropertyColumn1"/>
    <Property name="Property2" column="PropertyColumn2"/>
    <Property name="Property3" column="PropertyColumn3"/>
    <Property name="Property4" column="PropertyColumn4"/>
</Level>

如何返回这些属性的值以及我在架构文件中定义的度量值?

注意:我不想使用这些过滤器来过滤 MDX 查询中的结果,因此如果有更好的方法来获取我想要的数据,请告诉我! 谢谢!

I've defined a Dimension in a schema file containing multiple Levels. One of my Levels contains multiple properties, like:

<Level name="MyLevel" column="MyLevelColumn" nameColumn="MyLevelName">
    <Property name="Property1" column="PropertyColumn1"/>
    <Property name="Property2" column="PropertyColumn2"/>
    <Property name="Property3" column="PropertyColumn3"/>
    <Property name="Property4" column="PropertyColumn4"/>
</Level>

How can I return the values of these Properties, as well as the values of the measures I've defined in my Schema file?

Note: I don't want to use these filters to filter my results in the MDX query, so if there's a better way to get the data I want, please let me know! Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゝ杯具 2024-07-27 05:10:12

我不了解 Pentaho(在其网站的简短搜索中找不到任何 MDX 文档),但在 SSAS 中,您可以执行以下操作:

WITH
MEMBER [Measures].[Property1] AS 
    ([MyDim].[MyLevel].CurrentMember.Properties("Property1"))
SELECT
    {[Measures].[Property1], [Measures].[Amount]}
ON COLUMNS,
    {[MyDim].[MyLevel].MEMBERS}
ON ROWS
FROM [Cube]

I don't know about Pentaho (couldn't find any MDX docs in a brief search of their site), but in SSAS, you can do the following:

WITH
MEMBER [Measures].[Property1] AS 
    ([MyDim].[MyLevel].CurrentMember.Properties("Property1"))
SELECT
    {[Measures].[Property1], [Measures].[Amount]}
ON COLUMNS,
    {[MyDim].[MyLevel].MEMBERS}
ON ROWS
FROM [Cube]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文