dbTalk Databases Forums  

Sum syntax problem

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Sum syntax problem in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nedra
 
Posts: n/a

Default Sum syntax problem - 03-08-2006 , 11:54 AM






Hi All,

I'm extremely new to MDX, and I'm having some trouble getting one of my
expressions to work. I would appreciate any help with this hopefully
easy problem.

I have a cube like this:

Subcription_CruiseId
HomeAirportId
AccountId

With dimensions like this:

(related to Subcription_CruiseId)
SubscriptionStatusId
SubscriptionStatus

(related to HomeAirportId)
AirportId
AirportCode

The account id is a measure that has a distinct count for its aggregate
function property.

I am trying to find the total number of accounts that are subscribed to
recieve cruise info and have a home airport of Seattle or Houston.
This is my MDX statement:

select
sum (
{ [HomeAirportCode_Dim].[SEA]
, [HomeAirportCode_Dim].[IAH] }
, Measures.[Account Id] )
on columns,
{ [SubCruise_Dim].[Subscribed]}
on rows
from Account_Fact

I get an error: Unable to open cell set - Formula Error - cannot
convert expression to set - in a statistical set 1 function.

Would someone tell me what I'm doing wrong?

TIA,
Nedra


Reply With Quote
  #2  
Old   
Voorshwa
 
Posts: n/a

Default Re: Sum syntax problem - 03-08-2006 , 12:27 PM






I'm not 100% sure but I think all you need to do is surround your sum
statement with curly braces signifying that it is a set. Here is the
MDX

select
{
sum (
{ [HomeAirportCode_Dim].[SEA]
, [HomeAirportCode_Dim].[IAH] }
, Measures.[Account Id] )
}
on columns,
{ [SubCruise_Dim].[Subscribed]}
on rows
from Account_Fact

See if that works.

V


Reply With Quote
  #3  
Old   
Nedra
 
Posts: n/a

Default Re: Sum syntax problem - 03-08-2006 , 12:38 PM



That didn't work. It gave me a formula syntax error. It says that
the token is not valid.

Nedra


Reply With Quote
  #4  
Old   
Akshai Mirchandani [MS]
 
Posts: n/a

Default Re: Sum syntax problem - 03-08-2006 , 03:05 PM



You can't write value returning expressions on an axis. You would need to do
something like this:

WITH MEMBER Measures.x as 'sum (
{ [HomeAirportCode_Dim].[SEA], [HomeAirportCode_Dim].[IAH] }
, Measures.[Account Id] )'
SELECT { Measures.x } ON 0,
{ [SubCruise_Dim].[Subscribed]}
on rows
from Account_Fact

Thanks,
Akshai

--
--
This posting is provided "AS IS" with no warranties, and confers no rights
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

"Voorshwa" <voorshwa (AT) gmail (DOT) com> wrote

Quote:
I'm not 100% sure but I think all you need to do is surround your sum
statement with curly braces signifying that it is a set. Here is the
MDX

select
{
sum (
{ [HomeAirportCode_Dim].[SEA]
, [HomeAirportCode_Dim].[IAH] }
, Measures.[Account Id] )
}
on columns,
{ [SubCruise_Dim].[Subscribed]}
on rows
from Account_Fact

See if that works.

V




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.