dbTalk Databases Forums  

Issue with Member creation. Need help.

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


Discuss Issue with Member creation. Need help. in the microsoft.public.sqlserver.olap forum.



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

Default Issue with Member creation. Need help. - 08-02-2006 , 07:56 PM






Hi,

I am getting the following error.
"Members belong to different hierarchies in the function."

Basically i am trying to build Region Level Member from a State Level Member
in the MDX statement. Then count the number of invoices generated in that
region.

Please help with the MDX statement to achieve this.


WITH
MEMBER [Measures].[Count] as
'count(exists([sales].[invoice_id].MEMBERS,{[tIME].&[2006]}, "SALES MEASURE
GROUP"))'
MEMEBER [Geography].[State_Cd].[State Set] as
'AGGREGATE ({[Geography].[State_Cd].&[CT],[Geography].[State_Cd].&[MA]})'

MEMEBER [Geography].[Region_Cd].[Region Set] as
'AGGREGATE ({[Geography].[State_Cd].[State Set]
,[Geography].[Region_Cd].&[NE]})'

Select {[Measures].[Count]} on columns
from
[SALES MODEL]
WHERE
([Geography].[Region_Cd].[Region Set] )

Thanks,

Prasad.

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Issue with Member creation. Need help. - 08-02-2006 , 11:45 PM






A couple of observations:

- If [Geography].[Region_Cd] and [Geography].[State_Cd] are attributes
which both appear in a user hierarchy like [Geography].[Region-State],
use this single heirarchy.

- Aggregating a calculated member may be problematic


An example of a user hierarchy in Adventure Works:

Quote:
With
Member [Geography].[Country].[Country Set] as
Aggregate({[Geography].[State-Province].&[AL]&[US],
[Geography].[State-Province].&[AZ]&[US],
[Geography].[Country].&[Canada]})
select {[Measures].[Reseller Sales Amount]} on 0
from [Adventure Works]
where [Geography].[Country].[Country Set]
----------------------------------------------------
Members belong to different hierarchies in the function.
Quote:


With
Member [Geography].[Country].[Country Set] as
Aggregate({[Geography].[Geography].[State-Province].&[AL]&[US],
[Geography].[Geography].[State-Province].&[AZ]&[US],
[Geography].[Geography].[Country].&[Canada]})
select {[Measures].[Reseller Sales Amount]} on 0
from [Adventure Works]
where [Geography].[Country].[Country Set]
----------------------------------------------------------
Reseller Sales Amount
$15,855,940.20
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.