When I execute this mdx query from ssms it comes back in about 6 minutes with complete results. When executing the same query from within the asp .net application, an exception is thrown after about 500ms saying "the operation was cancelled". The server being connected to is aas (azure ssas) in tabular mode. The app's user has admin rights on aas. The query ram limit is 40g.
The mdx translated to adventure works:
with member measures.totalAfter as sum(
filter([internet sales].[ship date].members,
[internet sales].[ship date].currentmember.member_value >= cdate("01-01-2012")),
measures.[internet total sales])
select {measures.totalAfter} on columns,
{[internet sales].[customer id].[customer id]} on rows
from [Adventure Works Internet Sales Model];
the C#:
using(AdomdCommand command = new AdmodCommand(mdx, connection)) {
using(AdomdDataReader results = command.ExecuteReader()) {
foreach(var result in results) {
//...
}
}
}
Other queries do work from the asp app, including the unfiltered version of this one:
select {measures.[internet total sales]} on columns,
{[internet sales].[customer id].[customer id]} on rows
from [Adventure Works Internet Sales Model];
After further debugging, I discovered there was a null pointer error inside the foreach loop. That exception was getting discarded in favor of the less useful cancelled operation exception when one of the using statements was cleaning up.