Saturday, February 25, 2012

Problem with values returned by Calculated Member

Dear Friends,

I have a problem with CM:

Example

Row Field1 Field2 Field3 Total

1 31662 1 14,75 467014,5

2 250000 1 6,94 1735000

Total for each row= Field1*Field3 / Field2

The value I want for Calculated Member is Total1 + Total 2, 2202014,5, but the value is wrong... The calculated member gives me the value from: SUM Field1* SUM Field3 / SUM Field2, 3054624,39

The MDX:

[Measures].[Open Pos]*[Measures].[New Price]/[Measures].[Fx Rate Rep Cur]

And all the measures are with AggregateFunction as SUM...

Where is the problem? How can I calculate each row in spite of the sum?

Thanks!!

More help to you:

29-12-2006

BANCO PASTOR SA

31662

1

14,75

467.014,50

29-12-2006

GALP ENERGIA SGPS SA B

250000

1

6,94

1.735.000,00

For the date 29.12.2006 I want the calculated member with the value 2202014,5

And currently I'having the value 3054624,39.

|||Is the required calculation Sum(Field 1 * Field 3) / Sum (Field 2)? If so, try adding a calculated column to the DSV that does the (Field 1 * Field 3) calculation. Add this as a new measure, with Sum as the aggregation function. Then your calculated measure will be (New Measure) / (Field 2).|||

for the date 29-12-2006 I need to calculate each line of fact Table...

Example:

Date

Field1

Field2

Field3

EachRow

29-12-2006

100

1

5

500

29-12-2006

200

1

4

800

29-12-2006

300

1

2

600

Correct

1900

As I did, in Calculated Member, the value returned is not 1900, but is 2200!! :-(

29-12-2006

600

3

11

2200

Understood?

Thanks!

|||

Then just add the entire calculation ( (Field 1 * Field 3) / Field 2 ) as a calculated column in your DSV. Create a new measure on that column, and set the AggregationFunction to SUM.

Anytime you need something calculated at the fact level, it's usually best to either add it to fact table directly, or include it in the DSV.

|||But field1 is a named calculation, and I cant use this value to create a new named calculation... :-(|||You should be able to replicate the calculation for Field1 in your new calculated column.|||

How can I do it?

When I am creating the second named calculation, in the expression textbox I wrote: [Field1]+1

and returned me the error message: Invalid column named 'Field1'

Field1 is a named calculation... :-(

|||Copy the expression from Field1 into Field2, and add the additional calculations that need to be performed.|||

The problem is that the calculations in named calculation Field 1 is not so simple...

yeh.. but I understood that is no possible call a NC from another NC... thanks!

No comments:

Post a Comment