dbTalk Databases Forums  

ClosingPeriod to slice more than one dimension

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


Discuss ClosingPeriod to slice more than one dimension in the microsoft.public.sqlserver.olap forum.



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

Default ClosingPeriod to slice more than one dimension - 11-21-2005 , 12:35 PM






Hi,

I am having a difficulty to view the Measures: OS End Month, for
dimensions more than one.

Single Dimension: Ok no problem on this
([Measures].[Os End Month], ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember)

Mutliple Dimension:
([Measures].[Os End Month], ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember),ClosingPeriod (
[DIM_UW_Year].[Uw Year], [DIM_UW_Year].CurrentMember))

By using the above statement, I can only view the amount if both
dimensions are selected together.

My intention: Assuming I have THREE Dimensions, I would like have the
flexibility on this measure ([Measures].[Os End Month]) to view in one
or both or three of the dimensions.

Kindly need advice for the issue.

Thanks

regards,
JW


Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: ClosingPeriod to slice more than one dimension - 11-21-2005 , 07:51 PM






If you are using AS2k5, then you could use code like the following to
see if the current member for each dimension is the at the all level. If
you don't have an all level you can alter the check to test if it is at
the top level using something like
[DIM_Account_Date_Year].CurrentMember.Level.Ordinal = 0

([Measures].[Os End Month], IIF([DIM_Account_Date_Year].CurrentMember IS
[DIM_Account_Date_Year].[All DIM_Account_Date_Year] ,
[DIM_Account_Date_Year].[All DIM_Account_Date_Year] ,ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember),
IIF([DIM_UW_Year].CurrentMember IS [DIM_UW_Year].[All DIM_UW_YEAR] ,
[DIM_UW_Year].[All DIM_UW_YEAR], ClosingPeriod (
[DIM_UW_Year].[Uw Year], [DIM_UW_Year].CurrentMember))

If you are using AS2k it gets a bit messier as the iif function in AS2k
can only return numbers or strings (in AS2k5 iif can return any valid
MDX expression) so you would probably have to use member names as a bit
of a hack.

([Measures].[Os End Month], StrToMember(IIF
([DIM_Account_Date_Year].CurrentMember IS [DIM_Account_Date_Year].[All
DIM_Account_Date_Year] , [DIM_Account_Date_Year].[All
DIM_Account_Date_Year].UniqueName ,ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember).UniqueName)), StrToMember(
IIF([DIM_UW_Year].CurrentMember IS [DIM_UW_Year].[All DIM_UW_YEAR] ,
[DIM_UW_Year].[All DIM_UW_YEAR].UniqueName, ClosingPeriod (
[DIM_UW_Year].[Uw Year], [DIM_UW_Year].CurrentMember).UniqueName))

HTH

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1132598107.329812.7840 (AT) g47g2000cwa (DOT) googlegroups.com>,
junwinlestari (AT) gmail (DOT) com says...
Quote:
Hi,

I am having a difficulty to view the Measures: OS End Month, for
dimensions more than one.

Single Dimension: Ok no problem on this
([Measures].[Os End Month], ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember)

Mutliple Dimension:
([Measures].[Os End Month], ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember),ClosingPeriod (
[DIM_UW_Year].[Uw Year], [DIM_UW_Year].CurrentMember))

By using the above statement, I can only view the amount if both
dimensions are selected together.

My intention: Assuming I have THREE Dimensions, I would like have the
flexibility on this measure ([Measures].[Os End Month]) to view in one
or both or three of the dimensions.

Kindly need advice for the issue.

Thanks

regards,
JW



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

Default Re: ClosingPeriod to slice more than one dimension - 11-24-2005 , 11:59 AM



Hi,

Thanks for the replied for the above issue, I am using Analysis Service
2000, for the past few days, I had tried the method you mentioned, but
still i have some problem with the syntax. Appreciate for your
direction to correct the logic below:

iif([DIM_Account_Date_Year].CurrentMember.Level.Ordinal > 0,
([Measures].[Os End Month], StrToMember(IIF
([DIM_Account_Date_Year].CurrentMember IS [DIM_Account_Date_Year].[All
DIM_Account_Date_Year] , [DIM_Account_Date_Year].[All
DIM_Account_Date_Year].UniqueName ,ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember).UniqueName)), StrToMember(
IIF([DIM_UW_Year].CurrentMember IS [DIM_UW_Year].[All DIM_UW_YEAR] ,
[DIM_UW_Year].[All DIM_UW_YEAR].UniqueName, ClosingPeriod (
[DIM_UW_Year].[Uw Year], [DIM_UW_Year].CurrentMember).UniqueName))
)

regards,
Junwin

Mangorind wrote:
Quote:
Hi,

I am having a difficulty to view the Measures: OS End Month, for
dimensions more than one.

Single Dimension: Ok no problem on this
([Measures].[Os End Month], ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember)

Mutliple Dimension:
([Measures].[Os End Month], ClosingPeriod (
[DIM_Account_Date_Year].[Account The Month],
[DIM_Account_Date_Year].CurrentMember),ClosingPeriod (
[DIM_UW_Year].[Uw Year], [DIM_UW_Year].CurrentMember))

By using the above statement, I can only view the amount if both
dimensions are selected together.

My intention: Assuming I have THREE Dimensions, I would like have the
flexibility on this measure ([Measures].[Os End Month]) to view in one
or both or three of the dimensions.

Kindly need advice for the issue.

Thanks

regards,
JW


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.