dbTalk Databases Forums  

Re: Urgent: Problem with Calculated Member to get Amount x Price)

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


Discuss Re: Urgent: Problem with Calculated Member to get Amount x Price) in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sean Boon [MS]
 
Posts: n/a

Default Re: Urgent: Problem with Calculated Member to get Amount x Price) - 07-15-2003 , 12:08 PM






I think the problem that you are seeing is that if you create a calculated
member based on the two measures (Amount and Price) that the data doesn't
roll up correctly in Analysis Services. Here's how you solve that problem.

Use a view in which you have a column that multiplies out amount and price
and use that view as the fact table. You can then create a regular measure
based on that column and the data will roll up correctly. You can also use
your existing fact table and just specify the following for the source
column of the measure

"tablename"."amount" * "tablename"."price". There's actually an example of
this in one of the Foodmart 2000 cubes.

Sean


--
Sean Boon
SQL Server BI Product Unit

Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.

"michael" <ekleinm (AT) gmx (DOT) de> wrote

Quote:
Hi,

I want to introduce a calculated member for getting
the product of amount and price. The amount is in
a hierarchical structure and aggregates on the upper
levels.
For the price it would be necessary to put the
average to the upper levels, that the product of
amount and price would be correct for the other levels of
the hierarchie. How to define the calculated member PRICE?
Thanks and best Regards,
Michael



Reply With Quote
  #2  
Old   
Michael
 
Posts: n/a

Default Re: Urgent: Problem with Calculated Member to get Amount x Price) - 07-16-2003 , 02:21 AM






Hi Sean,

thank you very much for your reply. I forgot to tell you,
that it would be
a planning projekt, so I work with the write back table
and it dont work as
you describe.

Description:
amount is the measure to plan
price is the fix measure (the roll up must be a average)

amount * price would be calculated

The roll up of amount works correktly.
The roll up of price dont work correktly, I would need the
average of the
price Or
the roll up of the calculated (amount * price) must work,
so I can calculate
the price for the aggregated levels by the sum(amount *
price from the
leafes) / sum(amount)

I tested a "before insert" trigger to calculate the amount
* price before
inserting the records in the write back table, but this
didn't work because
there is in every row only the delta of one measure, the
other are 0.

Do you have any idea to solve these problem.

Thank you very much,
Michael


Quote:
-----Original Message-----
I think the problem that you are seeing is that if you
create a calculated
member based on the two measures (Amount and Price) that
the data doesn't
roll up correctly in Analysis Services. Here's how you
solve that problem.

Use a view in which you have a column that multiplies out
amount and price
and use that view as the fact table. You can then create
a regular measure
based on that column and the data will roll up
correctly. You can also use
your existing fact table and just specify the following
for the source
column of the measure

"tablename"."amount" * "tablename"."price". There's
actually an example of
this in one of the Foodmart 2000 cubes.

Sean


--
Sean Boon
SQL Server BI Product Unit

Disclaimer : This posting is provided "AS IS" with no
warranties, and
confers no rights.

"michael" <ekleinm (AT) gmx (DOT) de> wrote in message
news:0ac101c34ab5$66792fe0$a101280a (AT) phx (DOT) gbl...
Hi,

I want to introduce a calculated member for getting
the product of amount and price. The amount is in
a hierarchical structure and aggregates on the upper
levels.
For the price it would be necessary to put the
average to the upper levels, that the product of
amount and price would be correct for the other levels
of
the hierarchie. How to define the calculated member
PRICE?
Thanks and best Regards,
Michael


.


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.