SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


WriteBack Weighted Allocation doesn't work properly


WriteBack Weighted Allocation doesn't work properly

Author
Message
radzyck
radzyck
SSC Journeyman
SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)

Group: General Forum Members
Points: 87 Visits: 122
I have an issue about weighted allocation. I'm trying to allocate on leafs of a user defined hierarchy which has the dimension key on the leaf level. The allocation have to be done based on the rolling 12 months. Below is the script I'm using on SSAS 2012:

UPDATE [CUBE]
SET ( [Time].[YM].[Month Name].&[201312] -- leaf
, [Dim1].[Hierarchy1].[Level3].&[101] -- to be allocated on the leafs ([Dim1].[Hierarchy1].[Level4])
, [Measures].[Sales TG] -- measure
) = 10000
USE_WEIGHTED_ALLOCATION BY -- get share of each leaf from level4 based on the total level3
SUM((PARALLELPERIOD([Time].[YM].[Month Name], 11, [Time].[YM].[Month Name].&[201312]):[Time].[YM].[Month Name].&[201312]
, [Dim1].[Hierarchy1].CURRENTMEMBER)
, [Measures].[Sales]
)
/
SUM((PARALLELPERIOD([Time].[YM].[Month Name], 11, [Time].[YM].[Month Name].&[201312]):[Time].[YM].[Month Name].&[201312]
, [Dim1].[Hierarchy1].[Level3].&[101])
, [Measures].[Sales]
)
I saw some examples which don't use SUM, but if I remove the SUM operator I'm getting this error:

"The function expects a string or numeric expression for the argument. A tuple set expression was used."

Using SUM will update only one cell in the level4, which is not what I am expecting from this approach.

Can you please help me with it?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search