0
votes

I don't understand how to use LinRegPoint MDX function to show actual and estimated values of measures.

I have a MDX query that returns vales of two measures for each dimension member e.g:

WITH SET Product AS ...

SELECT

{[Measures].Size, [Measures].Cost } on 0,

Product on 1

FROM MyCube

This works fine and returns me size and cost on columns and repeat values for all products in separate rows. I want to apply linear regression in order to see what would be predicted value of cost based on size and calculate error. I don't need any prediction so I'm using the current values. How can I include estimated cost column using LinRegPoint method? Looking at the article (http://technet.microsoft.com/en-us/library/ms144752.aspx) I tried something like:

WITH SET Product AS ...

SELECT

{[Measures].Size, [Measures].Cost

   , LinRegPoint([Measures].Size, Products, [Measures].Size, [Measures].Cost)
  } on 0,

Product on 1 FROM MyCube

However, it return an error: The function expects a tuple set expression for the 3 argument. A string or numeric expression was used.

According to the http://technet.microsoft.com/en-us/library/ms144752.aspx thrd argument should be numeric expression Numeric_Expression_y so what is wrong here?

The only difference was that I have not used some period (e.g. Last(10) as in MSDN) because I want to apply regression across all products. I don't find the MSDN useful for this so could someone explain me how LinRegPoint should be used using this simple example?

1

1 Answers

0
votes

I guess the issue is not with the argument of the LinRegPoint MDX function but with LinRegPoint call; LinRegPoint returns a numerical value that cannot be added to the axis set :

WITH 
  SET Product AS ...
  MEMBER LRP as LinRegPoint([Measures].Size, Products, [Measures].Size, [Measures].Cost)

SELECT 
  { [Measures].Size, [Measures].Cost, LRP } on 0,
  Product on 1 
FROM MyCube