SQLServerCentral » Data Warehousing » Analysis Services » Problem Measure Calculated dynamically (error #VALUE!)InstantForum 2016-2 FinalSQLServerCentralhttps://www.sqlservercentral.com/Forums/SQLServerCentralSun, 23 Jul 2017 15:12:56 GMT20Problem Measure Calculated dynamically (error #VALUE!)https://www.sqlservercentral.com/Forums/FindPost1438706.aspxHello,
I have a problem to calculate the variance.
Here is the code I use:
Axis([Measures]).item(0)-Axis([Measures]).item(1)
Dynamically, the calculated measure makes the subtraction between the first measure and the second measure.
On the other hand, when that I add dimensions, an error displays.
Help !
Thank you very much.Thu, 04 Apr 2013 22:30:42 GMTwalter.antoRE: Problem Measure Calculated dynamically (error #VALUE!)https://www.sqlservercentral.com/Forums/FindPost1439088.aspx[quote][b]walter.anto (4/4/2013)[/b][hr]Hello,
I have a problem to calculate the variance.
Here is the code I use:
Axis([Measures]).item(0)-Axis([Measures]).item(1)
Dynamically, the calculated measure makes the subtraction between the first measure and the second measure.
On the other hand, when that I add dimensions, an error displays.
Help !
Thank you very much.[/quote]
The axis function seems like overkill for the requirement. How about :
[code="sql"]WITH Member [Measures].[ItemVariance] as
(
[Measures].[Name of First Measure] - [Measures].[Name of Second Measure]
)[/code]
I wonder about it being called variance though. Variance is a statistical value related to standard deviation (standard deviation squared).
Subtracting one from the other would be the "difference".
Thu, 04 Apr 2013 22:30:42 GMTdavoscollective