Analysis Services Calculation HELP (Using 2 measures in 1 calculation) -
11-17-2006
, 09:49 AM
Hey all,
I am having a problem calculating something. My formula is (Present
Market Value)-(Previous Market Value)-(Capital Added)
I am able to get the Present-Previous Market Value by this:
Create Member CurrentCube.[Snapshot].[MonthDate Snapshot Calculations].
[Market Change] AS "NA";
Scope(
{
[Measures].[Market Value - Combined Valuation]
}
);
( [Snapshot].[MonthDate Snapshot Calculations].[Market Change],
[Snapshot].[MonthDate].[MonthDate].Members ( 1 ) : Null ) =
( [Snapshot].[MonthDate Snapshot Calculations].DefaultMember ) -
( [Snapshot].[MonthDate Snapshot Calculations].DefaultMember,
ParallelPeriod(
[Snapshot].[MonthDate].[MonthDate],
1,
[Snapshot].[MonthDate].CurrentMember
)
);
( [Snapshot].[MonthDate Snapshot Calculations].[Market Change],
[Snapshot].[MonthDate].[MonthDate].Members ( 0 ) ) = Null;
End Scope;
Now all i have to do is subtract the Capital Added. I have the capital
in a column and have been able to calculate the capital added
separately from this calculation by:
Create Member CurrentCube.[Snapshot].[MonthDate Snapshot Calculations].
[Capital Added] AS "NA";
Scope(
{
[Measures].[Capital]
}
);
( [Snapshot].[MonthDate Snapshot Calculations].[Capital Added],
[Snapshot].[MonthDate].[MonthDate].Members ( 1 ) : Null ) =
( [Snapshot].[MonthDate Snapshot Calculations].DefaultMember ) -
( [Snapshot].[MonthDate Snapshot Calculations].DefaultMember,
ParallelPeriod(
[Snapshot].[MonthDate].[MonthDate],
1,
[Snapshot].[MonthDate].CurrentMember
)
);
( [Snapshot].[MonthDate Snapshot Calculations].[Capital Added],
[Snapshot].[MonthDate].[MonthDate].Members ( 0 )
) = Null;
End Scope;
Now all i have to do is subtract the capital added from my
present-previous market value calculation but i am unable to do it for
some reason. I think its because they are from two different measures
but im not sure.
If anyone has any ideas, please let me know. And if any further
information would help, just let me know.
Thanks in advance |