dbTalk Databases Forums  

ClosingPeriod

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


Discuss ClosingPeriod in the microsoft.public.sqlserver.olap forum.



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

Default ClosingPeriod - 01-22-2004 , 08:06 AM






Hello All,

I have the following MDX statement:

WITH

MEMBER [Datum].[WD].[ Aggregation] AS ' AGGREGATE( { [Vorige werkdag] } ) '

MEMBER [Measures].[Open calls] AS '([Measures].[Open Calls Count],
ClosingPeriod([Datum].[WD].[Dag vd week],[Datum].[WD].CurrentMember))'

SELECT { [Measures].[Ant geopende calls], [Measures].[Open calls] } ON
COLUMNS ,

NON EMPTY { [Agents].[Alle Agents], DESCENDANTS( [Agents].[Alle Agents],
[Agents].[Naam] ) } ON ROWS

FROM [Support Agents] WHERE ( [Datum].[WD].[ Aggregation] )


PrevXDays is a set of members from the [Datum].[WD] dimension.
[Datum].[WD] dimension is a Year, Week, Day dimension.
The [Open calls] measure isn't calculated when I use the aggregation as the
slicer. When I use a single member as a slicer, it works perfect.

Perhaps some hints?

Thanks, Jaap



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

Default Re: ClosingPeriod - 01-23-2004 , 02:00 AM






Below is a recent post that addresses a similar situation, ie.
Aggregate() doesn't apply to a calculated measure. One option is such
cases is to use conditional logic like (I'm only guessing about how
[Open Calls] should work):

Quote:
MEMBER [Datum].[WD].[ Aggregation] AS
'Iif([Measures].CurrentMember is [Measures].[Open Calls],
([Measures].[Open Calls Count],
Tail([Vorige werkdag]).Item(0)),
AGGREGATE({[Vorige werkdag]}))'
Quote:
http://groups.google.com/groups?dq=&...UTF-8&selm=uHE
sUG83DHA.1672%40TK2MSFTNGP12.phx.gbl
Quote:
From: Deepak Puri (deepak_puri (AT) progressive (DOT) com)
Subject: Re: Getting the Descendants of a calculated member?
View: Complete Thread (2 articles)
Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2004-01-20 17:56:59 PST


The problem is that Aggregate() cannot be applied to Calculated Members
(refer to Remarks in SQL BOL). When no solve order is specified, [Months
In Quarter] is evaluated first/calculated last. This returns 0 because
Calculated Members have no descendants. When the Calculated Members on
[Time] are given a higher solve order, an error is returned, because
they are computing the Aggregate() of the Calculated Member: [Months In
Quarter].

If all measures have the SUM aggregation function, then using Sum() in
lieu of Aggregate() will work, like this:
...
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.