dbTalk Databases Forums  

Write back using weighted allocation

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


Discuss Write back using weighted allocation in the microsoft.public.sqlserver.olap forum.



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

Default Write back using weighted allocation - 05-02-2005 , 06:13 AM






Hi,

I'm looking for a weight_value_expression.

The following statemant writes the measure "Credit" to a
given account for a given period (the account "kto" isn't
a leaf cell, there are sub-accounts):

UPDATE CUBE [MyCube]
SET (
[Time].[2005].[Q1],
[Account].[kto],
[Measures].[Credit]
) = 1000
USE_WEIGHTED_ALLOCATION

That is okay.
But how can I weighted write back based on another Measure?
For example at the ratio of each "Balance" and total
of all sub-accounts of "kto", like this:

....
USE_WEIGHTED_ALLOCATION BY
( [Time].[2005].[Q1],
[Account].[kto],
[Measures].[Balance] ) /
( [Time].[2005].[Q1],
[Account].[kto],
[Measures].[Balance].Total??? )


I tried also:

....
USE_WEIGHTED_ALLOCATION BY
( [Time].[2005].[Q1],
[Account].[kto].CurrentMember,
[Measures].[Balance] ) /
( [Time].[2005].[Q1],
[Account].[kto],
[Measures].[Balance].ParentMember )

This dosn't work.

Can anybody help?
Thanks in advance.

Michael


Reply With Quote
  #2  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: Write back using weighted allocation - 05-02-2005 , 10:59 PM






USE_WEIGHTED_ALLOCATION BY
( [Measures].[Balance] ) /
( [Account].[kto],
[Measures].[Balance] )

--
==============================*=================== =
Mosha Pasumansky - http://www.mosha.com/msolap
Analysis Services blog at http://www.sqljunkies.com/WebL*og/mosha
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==============================*=================== =
"Michael Broede" <fmbr (AT) popmail (DOT) com> wrote

Quote:
Hi,

I'm looking for a weight_value_expression.

The following statemant writes the measure "Credit" to a
given account for a given period (the account "kto" isn't
a leaf cell, there are sub-accounts):

UPDATE CUBE [MyCube]
SET (
[Time].[2005].[Q1],
[Account].[kto],
[Measures].[Credit]
) = 1000
USE_WEIGHTED_ALLOCATION

That is okay.
But how can I weighted write back based on another Measure?
For example at the ratio of each "Balance" and total
of all sub-accounts of "kto", like this:

...
USE_WEIGHTED_ALLOCATION BY
( [Time].[2005].[Q1],
[Account].[kto],
[Measures].[Balance] ) /
( [Time].[2005].[Q1],
[Account].[kto],
[Measures].[Balance].Total??? )


I tried also:

...
USE_WEIGHTED_ALLOCATION BY
( [Time].[2005].[Q1],
[Account].[kto].CurrentMember,
[Measures].[Balance] ) /
( [Time].[2005].[Q1],
[Account].[kto],
[Measures].[Balance].ParentMember )

This dosn't work.

Can anybody help?
Thanks in advance.

Michael




Reply With Quote
  #3  
Old   
Michael Broede
 
Posts: n/a

Default Re: Write back using weighted allocation - 05-03-2005 , 08:32 AM



Hi,

thanks for the answer, the MDX works, but it seems
that the values aren't proper.

I play a little with the statement but I can't set
the right values.

Here is an MDX example:

UPDATE CUBE [MyCube]
SET (
[Time].[2003],
[Account].[Kto],
[Measures].[Credit]
) = 23000
USE_WEIGHTED_ALLOCATION BY
( [Measures].[Balance] ) /
( [Account].[Kto],
[Measures].[Balance] )

I set the measure "Credit". The original credits
are all 0.00 and I want to set it at the same
values like "Balance" using weighted allocation.

The result of the MDX above is:

-------------------------------
Year
2003
-------
Account SubAcc Balance Credit
------- ------ ------- --------
Kto 4203 1.200 7.771
4210 5.300 63.978
4213 200 5.750
4225 1.100 14.102
4239 1.700 19.209
4242 3.300 28.673
4254 4.800 54.433
4286 2.600 22.037
4289 2.300 22.672
4294 500 -215.625
-------------------------------
Total 23.000 23.000
-------------------------------

You find a screenshot here:

http://www.broede-hro.de/bin/olap.jpg

There is still the question: How I have to construct
the "weighted_value_expression" to get the same
"Credit" values as the "Balance" values.

Please help.
Thanks in advance.

Michael


Mosha Pasumansky [MS] schrieb:

Quote:
USE_WEIGHTED_ALLOCATION BY
( [Measures].[Balance] ) /
( [Account].[kto],
[Measures].[Balance] )



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.