Excel cubevalue memberexpression

岁酱吖の 提交于 2021-02-08 10:16:31

问题


I am using the CubeValue function in Excel Powerpivot (2013) and would like to know if it is possible to use operators in the MemberExpression, particularly to retrieve values less than or greater than, e.g:

=CUBEVALUE("PowerPivot Data","[Measures].[CountofServiceID]","[Data].[ReportMonthNumber].&[<"&$P$4&"]")

The syntax above (<) is incorrect and I would like to know how to do this?

Thanks


回答1:


In general, I find it is easier to break cube function formulas up and use cubevalue to simply reference other fields. You can create a cubeset to do what you need.

If we put this is cell A2:

=cubemember("PowerPivot Data", "[Measures].[CountofServiceID]")

In some other cell, let's say A3, use this formula:

=Cubeset("PowerPivot Data","{[Data].[ReportMonthNumber].[All].[1]:[Data].[ReportMonthNumber].[All].["& $P$4 & "].lag(1)}"," Reporting Months")

The cell that should contain your value would be:

=cubevalue("PowerPivot Data", A2, A3)


来源:https://stackoverflow.com/questions/34603580/excel-cubevalue-memberexpression

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!