简体   繁体   中英

MDX query in cube calculation

I've created a simple cube calculation that sums two measures.I only want to sum, or to return data when both measures return a value.

When I use the calculation in an MDX query, it works as expected, however when I browse the cube via a pivot table I it display all results, and not what I need. It seems to me that I need to modify the cube calculation to get the same NONEMPTY behaviour as per the MDX query, but I just can't get the syntax correct, or know if this is indeed the correct approach. I'd be grateful for some pointers.

MDX查询

Sample of underlying data:

基础数据

Cube calculation:

简单添加两个措施

This MDX statement does exactly what I want it to:

根据需要的MDX查询结果

The IIF function would be useful in this scenario

For eg,

CREATE MEMBER CURRENTCUBE.[Measures].[RevalCombined]
AS IIF([Measures].[Reval]=0, NULL, [Measures].[Reval]) + IIF([Measures].[dReval]=0, NULL, [Measures].[dReval])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM