SQLServerCentral » Data Warehousing » Analysis Services » Problem Measure Calculated dynamically (error #VALUE!)InstantForum 2016-2 FinalSQLServerCentralhttps://www.sqlservercentral.com/Forums/SQLServerCentralThu, 27 Apr 2017 12:50:58 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