Monday, March 19, 2012

MDX: sum with condition on 2 fields

Hello,

I have a table which contains 2 fields, "Contract Number" and "CN Number".

When the 2 fields are equals I want to do the difference between the price link to the contract number - the price link to the CN Number.

Moreover the Contract Number and the CN number are never the same on the same record.

Here is an example:

Contract Number / CN Number / Price

...

1000A 100

....

1B 1000A 30

....

So for the Contract Number 1000A, I want 100 - 30 = 70

I don't know how to do that in MDX...

Any idea is welcome.

Thanks,

Guillaume

i would never do this in mdx because dependend on your requirements it may be really difficult or impossible, but sure slow.

why you not calculate the differnce by SQL and add the result as a new measure. (hidden if required)- it fast compared to mdx

best regards

HANNES

No comments:

Post a Comment