开发者

Multiplying Quantity * Price in Calculated Member

开发者 https://www.devze.com 2023-03-30 01:14 出处:网络
I know MDX is used for much more sophisticated math, so please forgive the simplistic scenario, but this is one of my first Calculated members.

I know MDX is used for much more sophisticated math, so please forgive the simplistic scenario, but this is one of my first Calculated members.

When I multiply Price x Quantity, the AS cube's data browser has the correct information in the leaf elements, but not in any of the parents. The reason seems to be that I want something like (1 * 2) + (2 * 3) + 开发者_C百科(4 * 5) and not (7 * 10) which think I am getting as a result of how the Sum is done on columns.

Is the IsLeaf expression intended to be used in these circumstances? Or is there another way? If so, are there any examples as simple as this I can see?

This Calculated member that I tried to create is just this:

[Measures].[Price]*[Measures].[Quantity]

The result for a particular line item (the leaf) is correct. But the results for, say, all of april, is an incredibly high number.

Multiplying Quantity * Price in Calculated Member

Edit: I am now considering that this might be an issue regarding bad data. It would be helpful though if someone could just confirm that the above calculated member should be work under normal circumstances.


Here it is a blog post dealing with this particular problem: Aggregating the Result of an MDX Calculation Using Scoped Assignments.


For leaf level computations resulting in something that can then be summed, MDX is rather complex and slow. The simplest way to do what you want to achieve would be to make this a normal measure, based on the Price x Quantity calculation defined in the data source view.

0

精彩评论

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

关注公众号