dbTalk Databases Forums  

Rollup Behavior

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


Discuss Rollup Behavior in the microsoft.public.sqlserver.olap forum.



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

Default Rollup Behavior - 03-09-2010 , 10:59 AM






I've created a few account cubes that roll up using unary operators
without issue. For example, when you drill down, the child sums up to
the parent.

100
--50
--35
-- -- 15
-- -- 20
-- 15
-- 5
-- 10

I've created a new one and for some odd reason, it is not summing up
all the way to the top. When I change the unary operator from + to -,
it appears that only the direct parent subtracts the number, but it
doesnt not trickel all the way up the tree.

I'm trying this solution because the are instances where I need to
change the value of the data from + to -. I cannot do this from the
ETL because the data rules proclude me from doing that.

I tried using a SCOPE

SCOPE
( [Account].[Accounts].Memebers, [Measures],[Amount];
THIS = (
IIF ([Accoount].[Reverse Sign].&[Y],
[Account].[Accounts].CurrentMember, [Measures],
[Amount] * -1,
[Account].[Accounts].CurrentMember, [Measures],
[Amount]))
);
END SCOPE

This sort of works except, it changes the sign of all the parents as
well.

So something that should look like this...

-- 75 (N)
-- -- 50 (N)
-- -- 25 (N)
-- -- -- 30 (N)
-- -- -- (-5) (Y)

looks like this

-- (-75) (N)
-- -- 50 (N)
-- -- (-25) (N)
-- -- -- 30 (N)
-- -- -- (-5) (Y)

The thing I notice is that if the member is not a parent anwhere up
the tree, it's sign is unaffected.

I know these are 2 seperate issues, but the Sign issue is the ideal
solution and the odd rollup issue is my Plan B.

Any suggestion is greatly appreciated.

Reply With Quote
  #2  
Old   
Mark Fitzgerald
 
Posts: n/a

Default Re: Rollup Behavior - 03-24-2010 , 08:05 AM






-- (-75) (N)
-- -- 50 (N)
-- -- (-25) (N)
-- -- -- 30 (N)
-- -- -- (-5) (Y)

Using the data above from your example the Unary column may now be giving
you the problem.

Given that the underlying data is :

A-- (-75) (N)
B-- -- 50 (N)
C-- -- (-25) (N)
D-- -- -- 30 (N)
E-- -- -- (-5) (Y)

Underlying DimAccount
ID ParentID UnaryOperator [Reverse Sign]
A NULL ~ N
B A - N
C A + N
D C - N
E C - Y


If E had a value of 5 then the value shown would be -5.
If D had a value of 30 then the value shown would be 30.

In the DimAccount the D and E columns both have (-) so that become :
C = -D - E
C = -30 - (-5)
C = -30 + 5
C = -25 (shown as (25) even though the [Reverse Sign] is N due to
value)

If B has a value of 50 then
A = -B + C
A = -50 + (-25)
A = -50 -25
A = -75 (shown as (75) even though the [Reverse Sign] is N due to
value)

To me there is a discrepancy due to the values passed in, the [reverse
sign[ attribute and the unary operator. But not seeing the structure you
have makes it more difficult.

Fitz








"Carmaboy" <carmaboy (AT) gmail (DOT) com> wrote

Quote:
I've created a few account cubes that roll up using unary operators
without issue. For example, when you drill down, the child sums up to
the parent.

100
--50
--35
-- -- 15
-- -- 20
-- 15
-- 5
-- 10

I've created a new one and for some odd reason, it is not summing up
all the way to the top. When I change the unary operator from + to -,
it appears that only the direct parent subtracts the number, but it
doesnt not trickel all the way up the tree.

I'm trying this solution because the are instances where I need to
change the value of the data from + to -. I cannot do this from the
ETL because the data rules proclude me from doing that.

I tried using a SCOPE

SCOPE
( [Account].[Accounts].Memebers, [Measures],[Amount];
THIS = (
IIF ([Accoount].[Reverse Sign].&[Y],
[Account].[Accounts].CurrentMember, [Measures],
[Amount] * -1,
[Account].[Accounts].CurrentMember, [Measures],
[Amount]))
);
END SCOPE

This sort of works except, it changes the sign of all the parents as
well.

So something that should look like this...

-- 75 (N)
-- -- 50 (N)
-- -- 25 (N)
-- -- -- 30 (N)
-- -- -- (-5) (Y)

looks like this

-- (-75) (N)
-- -- 50 (N)
-- -- (-25) (N)
-- -- -- 30 (N)
-- -- -- (-5) (Y)

The thing I notice is that if the member is not a parent anwhere up
the tree, it's sign is unaffected.

I know these are 2 seperate issues, but the Sign issue is the ideal
solution and the odd rollup issue is my Plan B.

Any suggestion is greatly appreciated.

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 - 2013, Jelsoft Enterprises Ltd.