Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

The CURRENTMEMBER function expects a hierarchy expression for the 0 argument

293 views
Skip to first unread message

RPou...@gmail.com

unread,
Jun 21, 2008, 3:16:20 PM6/21/08
to
I have a dimension dimZoneProduct with a hierarchy
Zone – Product
. Zone
.. Product
I want to know what percentage has each product by zone

Zone A 20000 100%
Product 1 15000 75%
Product 2 5000 25%

I have the following dmx expresion
With Member [Measures].[ZoneProductPer] as
'([Dim Zone Product].[Zone - Product].[Zone].currentmember,[Measures].
[Sales])
/([Dim Zone Product].[Zone - Product].[Product].CURRENTMEMBER,
[Measures].[Sales])',
FORMAT_STRING = 'Percent'
SELECT {[Measures].[Qty],[Measures].[ZoneProductPer]} on columns,
NON EMPTY
CrossJoin(Hierarchize(AddCalculatedMembers({DrilldownLevel({[Dim Zone
Product].[Zone].Members})}))
,Hierarchize(AddCalculatedMembers({DrilldownLevel({[Dim
Zone Product].[Product].Members})})))
DIMENSION PROPERTIES PARENT_UNIQUE_NAME ON
rows
FROM [FLD Floor Price]
WHERE ([Dim Time].[FiscalYear].&[2008]) CELL PROPERTIES VALUE,
FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS

The column [Measures].[ZoneProductPer] shows the error
The CURRENTMEMBER function expects a hierarchy expression for the 0
argument. A member expression was used.


Please help me I need to finish this work ASAP. Thanks


Deepak Puri

unread,
Jun 23, 2008, 10:40:00 PM6/23/08
to
The error occurs because .CurrentMember is being applied to a level,
whereas it should be applied to a hierarchy. See if this version works:

With Member [Measures].[ZoneProductPer] as

'[Measures].[Sales]
/([Dim Zone Product].[Zone - Product].Parent,


[Measures].[Sales])',
FORMAT_STRING = 'Percent'

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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

0 new messages