开发者

For each implementation through SSAS 2005 MDX

I have this MDX expression in the Calculated member

(sum([Time Code].[Time Code Group Code],[Measures].[Event Duration])-SUM([Time Code].
[Time Code Group Code].&[MACHINE DELAY],[Measures].[Event Duration]))/(sum([Time Code].
[Time Code Group Code],[Measures].[ Event Duration]))

I want to perform this operation on records who have [Time Code] category as"Down"

i.e

[Time Code].[Time Code Category].&[Down].

How should I include this filter so that the calculation is performed only 开发者_运维知识库on records which have Category as DOWN.

Is there FOR each concept in MDX . Please guide on how should I proceed.


The MDX Generate function is the equivalent in MDX of for each. However you can't use it for sum. In icCube you could use functions to solve this, for ssas I'd use sets :

WITH
  SET [MyFilterSet] as Filter( [Time Code].[Time Code Category], <<condition>> )
...   sum( [MyFilteredSet], [Measures].[Event Duration] )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜