Amo And Adomd
Jan 6, 2008how can i use amo references and adomd references to gether in one project for connecting and showing model
how can i use amo references and adomd references to gether in one project for connecting and showing model
Logically speaking, the two cases below should behave the same. However case 2's output is wrong. Perhaps someone knows what's wrong in case 2.
Case 1:
-------------
AdomdCommand cmd = new AdomdCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "SELECT Cluster(), PredictCaseLikelihood()" +
" FROM [Data Validation]" +
" NATURAL PREDICTION JOIN" +
" (SELECT " +
" (SELECT @var0 as [var] " +
" UNION SELECT @var1 as [var] " +
" UNION SELECT @var2 as [var]) AS [vartable]) AS t";
Case 2
-------------
AdomdCommand cmd = new AdomdCommand();
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "SELECT Cluster(), PredictCaseLikelihood()" +
" FROM [Data Validation]" +
" NATURAL PREDICTION JOIN" +
" (SELECT " +
" (SELECT @var0 as [var] ";
for(int i=1; i<3; i++)
{
cmd.CommandText = cmd.CommandText +
"UNION SELECT @var" + i.ToString() + " as [var] ";
}
cmd.CommandText = cmd.CommandText + ") AS [vartable]) AS t";
Mary
Is there a way to access cubes via a web service?
Are there any built in web services for doing this in SSAS?
Do I have to have the ADOMD client installed before I can access or use data if it were possible to access it via a web service?
Hallo everyone,
I have a problem passing the [Set] object to a stored procedure that we use in a calculation of our Cube. Following Mosha Pasumansky indications in http://www.sqljunkies.com/WebLog/mosha/archive/2007/04/19/stored_procs_best_practices.aspx I avoided to use Tuples.count and Tuples[Index] but stll receive an €œInternal Error: An unexpected exception Occurred€?.
The error arrives randomly (sometimes the sproc works perfectly, like its €œsister€?, that we were forced to implement with arrays and strings, using the old SetToArray and SetToString mdx functions).
Our particularity is that our program is in Vb.Net. and here is the incriminated cycle:
Public Function Redditivita2(ByVal flusso0 As Double, ByVal setRateAMesi As [Set], ByVal fin_sca_map As Double) As Double
...
Dim tp As Tuple
Dim ntp As Long
ntp = 0
i = 0
For Each tp In setRateAMesi
If ntp Mod 2 = 0 Then
numAggr = CLng(tp.Members(0).Name)
mesi(i) = numAggr Mod 1000
proroga(i) = Int(numAggr / 1000)
If (mesi(i) > 120 Or proroga(i) > 120) Then
Err.Raise(vbObjectError + mnTroppeRate, , "Rateazioni a più di 120 mesi di durata o di proroga non previste - contattare Mappamondo Informatica s.r.l. se richieste")
End If
nrateamesi(i) = MDXValue.FromTuple(tp).ToDouble
Else
nmaxrateamesi(i) = MDXValue.FromTuple(tp).ToDouble
i = i + 1
End If
ntp = ntp + 1
Next
The set contains a cross join between a dimension and two measures (in the calculation we have: OLAPExtFunctionOpt!Redditivita2([Measures].[FLUSSO_0],NonEmpty(CROSSJOIN(.children, {[Measures].[RATA], [Measures].[RATA_MAXI]})),[Measures].[SCARTO_PES_GG])).
I installed SP2 and Cumulative HotFix. 3152. Does anybody has any idea? Has the problem any connection with msmgsdrv versions? Thank you very much for attention!
Hi all,
Can I get Samples for ADOMD.Net Server Programming
Thanks,
hi,
I need to write a clr stored prodeure.i have to call that stored procedure from my prediction query.My Application is going to make use of that query to get the prediction output.
Is it possible to write clr stored procedure with out using adomd server.How?
For example:
In My Assembly i am having a function PredictPerformance(),Which is having my DMX Query.I need to execute that function from my analysis service by calling like this,
select aly. PredictPerformance() FROM [Model].
how to do this?
Hi, I have a server-side stored procedure that I created in C#. The SP issues one DMX statement (within the implicit connection) which has a prediction join with SHAPE/APPEND. It then tries to map the results of the AdomdDataReaders to System.Data.DataTable objects, returning one System.Data.DataTable object. Because of the SHAPE/APPEND, I end up with two nested AdomdDataReaders.
Code Block
using Microsoft.AnalysisServices.AdomdServer;
using System.Data;
...
public DataTable VivaOMengoSP()
{
AdomdCommand c = new AdomdCommand(CreatePredictedDMX());
// select ... prediction join ... shape ... append
DataTable dt = new DataTable();
dt.Columns.Add("att1", typeof(string));
dt.Columns.Add("att2", typeof(int));
dt.Columns.Add("predictednestedmonster", typeof(DataTable));
object[] row = new object[3];
try
{
AdomdDataReader dr = c.ExecuteReader();
while (dr.Read())
{
DataTable innerdt = new DataTable();
innerdt.Columns.Add("inneratt1", typeof(int));
innerdt.Columns.Add("inneratt2", typeof(string));
row[0] = dr[0];
row[1] = dr[1];
AdomdDataReader innerdr = (AdomdDataReader)dr[2];
object[] innerrow = new object[2];
while (innerdr.Read())
{
innerrow[0] = innerdr[0];
innerrow[1] = innerdr[1];
innerdt.Rows.Add(innerrow);
}
row[2] = innerdt;
dt.Rows.Add(row);
}
dr.Close();
return dt;
}
catch
{
return null;
}
}
(The code is a modification to listing 20-3, page 807, of the book "Programming Microsoft SQL Server 2005" by Brust & Forte)
I call it directly in SSMS and I get this result:
Executing the query ...
Execution of the managed stored procedure VivaOMengoSP failed with the following error: Microsoft::AnalysisServices::AdomdServer::AdomdException.
Errors in the high-level relational engine. The System.Data.DataTable type is not supported by Analysis Services code name "Katmai".
Execution complete
Is it possible to have nested table as a SP result? Is DataTable the appropriate class?
Thanks,
Gustavo Frederico