MDX: Exclude a member that share same dimension property of a measure

十年热恋 提交于 2021-02-11 16:20:17

问题


Scenario: I have a measure( Sum ), and I need in all situations the result of this sum excluding the last element registered in the fact table respecting the user/day filter. These elements share the same attributes in the other dimensions.

Example: Measure of UserA in fact table in 2019/10/29:

RegisterA: 5
RegisterB: 11
RegisterC: 13
RegisterD: 7

( RegisterD will be not included in the result that the system user will see. Final result: 29 )

Example: Measure of UserB in fact table between 2019/10/26 to 2019/10/29:

RegisterA: 2
RegisterB: 45
RegisterC: 21
RegisterD: 19

( RegisterD will be not included in the result that the system user will see. Final result: 68 )

These elements share the same dimension property, without any difference, but the last fact register inside dimension filters( Day and User ) will never be included in the sum.

What can I do?

Thank You


回答1:


In your project you need to define each of your measures twice once with "sum" usage and once with "last value" usage. Now define a calculated member that substracts the last value from the sum. Use this calculated member in your queries.



来源:https://stackoverflow.com/questions/58613293/mdx-exclude-a-member-that-share-same-dimension-property-of-a-measure

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