MDX 中需要总计列
我有以下查询,它为我提供了一个摘录(我将其从我的多维数据集中放入 CSV 中)。
我想将列中所有 NRx 的总计显示为第一列 NRx,其余 NRx 列应该像现在一样出现。我尝试向其中添加 SUM (Measures.NRx),但它不起作用
如何获取总 NRx 列?
SELECT
NON EMPTY
CrossJoin
(
[Time Period].[Calendar].[Cycle Dt],
{
[Measures].[NRx]
}
)
ON COLUMNS,
NON EMPTY
{(
[Prescriber].[Prescriber Name].[Prescriber Name].Members
, [Prototype Alignment].[Tier Code].[Lilly Tier Code].Members
, [Prototype Alignment].[Territory Name].[Territory Name].Members
, [Prototype Alignment].[District Name].[District Name].Members
, [Prototype Alignment].[Division Name].[Division Name].Members
, [Prototype Alignment].[Area Name].[Area Name].Members
, [Market Product].[Product Group Nbr].[Product Group Nbr].Members
, [Market Product].[Product G Name Name].[Product G Name Name].Members
)} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM
(
SELECT
({
[Prescriber].[Ims Prescriber Id].&[011111]
}
,
{
[Time Period].[Cycle Dt].&[2008-10-03T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-10T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-17T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-24T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-31T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-07T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-14T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-21T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-28T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-05T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-19T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00]
}
) ON COLUMNS
FROM [Mart]
) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE,
FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
I have the following query that gives me an extract (I am putting this into a CSV from my cube).
I want to show the Total of all NRx in a column as the first column NRx and the rest of the NRx columns should come up as they do now. I tried to add a SUM (Measures.NRx) to this, but it did not work
How do I get a total NRx column?
SELECT
NON EMPTY
CrossJoin
(
[Time Period].[Calendar].[Cycle Dt],
{
[Measures].[NRx]
}
)
ON COLUMNS,
NON EMPTY
{(
[Prescriber].[Prescriber Name].[Prescriber Name].Members
, [Prototype Alignment].[Tier Code].[Lilly Tier Code].Members
, [Prototype Alignment].[Territory Name].[Territory Name].Members
, [Prototype Alignment].[District Name].[District Name].Members
, [Prototype Alignment].[Division Name].[Division Name].Members
, [Prototype Alignment].[Area Name].[Area Name].Members
, [Market Product].[Product Group Nbr].[Product Group Nbr].Members
, [Market Product].[Product G Name Name].[Product G Name Name].Members
)} DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM
(
SELECT
({
[Prescriber].[Ims Prescriber Id].&[011111]
}
,
{
[Time Period].[Cycle Dt].&[2008-10-03T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-10T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-17T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-24T00:00:00],
[Time Period].[Cycle Dt].&[2008-10-31T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-07T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-14T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-21T00:00:00],
[Time Period].[Cycle Dt].&[2008-11-28T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-05T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-12T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-19T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00],
[Time Period].[Cycle Dt].&[2008-12-26T00:00:00]
}
) ON COLUMNS
FROM [Mart]
) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE,
FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在第一个 Crossjoin 中,尝试
添加对日历层次结构的 All 成员的引用
In the first Crossjoin, where you have
Try adding a reference to the All member of the Calendar hierarchy