If I'm inside a stored procedure called by an MDX query, the following would query the cube and figure out the sales for the current tuple:
new Expression("[Measures].[Internet Sales Amount]").Calculate(null).ToDouble()
So I was expecting to be able to do that from within a stored proc called from a DMX predict query. I was hoping that I could evaluate the $Cluster expression from within a sproc and figure out what cluster the current row in the DMX query belongs to. Basically, I'm trying to make my sproc function signature more elegant so I don't have to pass in the NodeId like:
select $Cluster, MyAssembly.MySproc(PredictNodeId(Cluster())) as CoolData
from [Customer Clusters]
NATURAL PREDICTION JOIN
(select * from [Customer Clusters].Cases) as x
where $Cluster = 'Cluster 10'
Is there any way to do that?
Unfortunately no, although this is an improvement we are considering for future versions. The improvement could be to enable you to access the input case directly and/or call the models prediction functions.
No comments:
Post a Comment