dbTalk Databases Forums  

Custom rollup formula. How to exclude a member?

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


Discuss Custom rollup formula. How to exclude a member? in the microsoft.public.sqlserver.olap forum.



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

Default Custom rollup formula. How to exclude a member? - 08-25-2005 , 08:24 AM






I want to exclude a member in Time dimension which consists year, quarter,
month levels

I put this under quarter custom rollup formula,
SUM(Time.CurrentMember.children) - ????

What is the correct MDX if I want to
1. Exclude second month in a quarter?
2. Exclude March only in 2nd quarter?
3. Exclude First month in every quarter?

Thanks for your help



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

Default Re: Custom rollup formula. How to exclude a member? - 08-25-2005 , 09:02 PM






Something like:

1. SUM(Time.Children - {Time.FirstChild.NextMember})

2. SUM(Time.Children) - iif(Rank(Time.CurrentMember,
Time.Siblings) = 2, Time.LastChild, 0)

3. SUM(Time.Children - {Time.FirstChild})


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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

Reply With Quote
  #3  
Old   
Joel Leong
 
Posts: n/a

Default Re: Custom rollup formula. How to exclude a member? - 08-26-2005 , 02:01 AM



Thanks for your reply. I try to modify your MDX to another dimension but
seems it affects other dimension. Eg,

I have
Packaging_Product_Shop with level packaging, product, shop
Shop_Packaging_Product with level shop, packaging, product
dimension.

When I put in
SUM([Product_Packaging_Shop].CurrentMember.children-Shop.FirstChild) it works
for Product_Packaging_Shop but other dimension screwed up with #Value!. What
has happen?

"Deepak Puri" wrote:

Quote:
Something like:

1. SUM(Time.Children - {Time.FirstChild.NextMember})

2. SUM(Time.Children) - iif(Rank(Time.CurrentMember,
Time.Siblings) = 2, Time.LastChild, 0)

3. SUM(Time.Children - {Time.FirstChild})


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #4  
Old   
Brian Altmann
 
Posts: n/a

Default Re: Custom rollup formula. How to exclude a member? - 08-26-2005 , 08:29 AM



If I understand you correctly and you are using the same level name (Shop)
for more than one dimension, then you should always use the fully qualified
level name syntax : [dimension name].[level name]. Of course I'm not sure
this is what's causing your problem but not using the full name certainly
could produce unexpected results.
HTH,
--
Brian Altmann
BI Specialist
Huddle Group S.A (www.huddle.com.ar)
www.geocities.com/brianaltmann/olap.html


"Joel Leong" wrote:

Quote:
Thanks for your reply. I try to modify your MDX to another dimension but
seems it affects other dimension. Eg,

I have
Packaging_Product_Shop with level packaging, product, shop
Shop_Packaging_Product with level shop, packaging, product
dimension.

When I put in
SUM([Product_Packaging_Shop].CurrentMember.children-Shop.FirstChild) it works
for Product_Packaging_Shop but other dimension screwed up with #Value!. What
has happen?

"Deepak Puri" wrote:

Something like:

1. SUM(Time.Children - {Time.FirstChild.NextMember})

2. SUM(Time.Children) - iif(Rank(Time.CurrentMember,
Time.Siblings) = 2, Time.LastChild, 0)

3. SUM(Time.Children - {Time.FirstChild})


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #5  
Old   
Joel Leong
 
Posts: n/a

Default Re: Custom rollup formula. How to exclude a member? - 08-27-2005 , 03:40 AM



I'm uisng full dimension name but it still doesn't work? I guess i need to
include a IIF statement to test next level is a Shop? How to do that? Please
help


"Brian Altmann" <findme@thesignaturewebsite> wrote

Quote:
If I understand you correctly and you are using the same level name (Shop)
for more than one dimension, then you should always use the fully
qualified
level name syntax : [dimension name].[level name]. Of course I'm not sure
this is what's causing your problem but not using the full name certainly
could produce unexpected results.
HTH,
--
Brian Altmann
BI Specialist
Huddle Group S.A (www.huddle.com.ar)
www.geocities.com/brianaltmann/olap.html


"Joel Leong" wrote:

Thanks for your reply. I try to modify your MDX to another dimension but
seems it affects other dimension. Eg,

I have
Packaging_Product_Shop with level packaging, product, shop
Shop_Packaging_Product with level shop, packaging, product
dimension.

When I put in
SUM([Product_Packaging_Shop].CurrentMember.children-Shop.FirstChild) it
works
for Product_Packaging_Shop but other dimension screwed up with #Value!.
What
has happen?

"Deepak Puri" wrote:

Something like:

1. SUM(Time.Children - {Time.FirstChild.NextMember})

2. SUM(Time.Children) - iif(Rank(Time.CurrentMember,
Time.Siblings) = 2, Time.LastChild, 0)

3. SUM(Time.Children - {Time.FirstChild})


- 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.