Creating a calculated member using dimension members

Creating a calculated member using dimension members

Post by anderson_sa.. » Tue, 19 Dec 2000 20:19:24



I have a cube that tracks enquiries made against adverti*ts.
I want to calculate the cost per enquiry.
I am having real trouble generating a calculated member to accomplish
this.
I have a dimension - Advertisment, which has and "advert type"
an "advert slogan" and an "advert code" level.
I realise that "Advert cost" needs to be somehow linked to enquiry and
have tried using "Advert cost" as a member property of "advert code"
and as a virtual dimension and incorporating it into the new calculated
member.
I can't seem to get any functions like sum, min or max to work
against "Advert cost" (even though it is a numeric field).  The only
thing I can get is a count.
Is there a restriction against using these types of functions with
members that are not members of the measures dimension?
Does anyone have any pointers?

Sent via Deja.com
http://www.veryComputer.com/

 
 
 

Creating a calculated member using dimension members

Post by Formless On » Wed, 27 Dec 2000 10:00:30


I'm not sure exactly what you're looking for, but below is an MDX example of
creating a calculated measure that uses a member property to deliver an
aggregated value. The first step is to determine that the member property
can, indeed, be converted into a numeric value. If the member property is
null, for example, you'll end up with #ERR for aggregated values that
include such member properties. If you're sure that your member properties
are all populated, you can remove the second IIF check in the calculated
member below. Since some of the values in the Store SQFT member property are
null, however, it's needed for the example query.

Note, too, that this measure is recursive in nature. If it's on the last
level of the Store dimension, it returns the member property. For all other
levels, it uses itself as the measure for the SUM function.

WITH
MEMBER
   [Measures].[Sq Ft]
AS
   'IIF(
      Store.CURRENTMEMBER.LEVEL.NAME = "Store Name",
      IIF(
         IsNumeric(Store.CURRENTMEMBER.PROPERTIES("Store SQFT")),
         CDbl(Store.CURRENTMEMBER.PROPERTIES("Store SQFT")),
         0
      ),
      SUM(
         DESCENDANTS(Store.CURRENTMEMBER, [Store Name]),
         [Measures].[Sq Ft]
      )
   )'
SELECT
   {[Measures].[Unit Sales],  [Measures].[Sq Ft]} ON COLUMNS,
   Store.MEMBERS
 ON ROWS
FROM
   Sales

Hope this helps!

Dennis Kennedy
Formless Realm Consulting
www.formlessrealm.net


Quote:> I have a cube that tracks enquiries made against adverti*ts.
> I want to calculate the cost per enquiry.
> I am having real trouble generating a calculated member to accomplish
> this.
> I have a dimension - Advertisment, which has and "advert type"
> an "advert slogan" and an "advert code" level.
> I realise that "Advert cost" needs to be somehow linked to enquiry and
> have tried using "Advert cost" as a member property of "advert code"
> and as a virtual dimension and incorporating it into the new calculated
> member.
> I can't seem to get any functions like sum, min or max to work
> against "Advert cost" (even though it is a numeric field).  The only
> thing I can get is a count.
> Is there a restriction against using these types of functions with
> members that are not members of the measures dimension?
> Does anyone have any pointers?

> Sent via Deja.com
> http://www.veryComputer.com/


 
 
 

1. Analysis Services, Dimension Member ordering, Calculated Members

Simon, if you are doing financial app, I recommend creating real dimension
members with Custom Rollup Formula instead of calculated members.
This way you can control ordering by carefully chosing member keys and
asking Analysis Services to sort dimension by key.

HTH,
Mosha.

--
==================================================
Mosha Pasumansky (moshap at microsoft dot com)
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.
==================================================


2. beta3 and sp2

3. Adding Calculated Member to a Parent Member in the dimension through code

4. Different versions of Oracle on same server

5. Selecting parent member for calculated member in dimension with alternative hieararchies

6. DTS Transformations

7. Analysis Services, Dimension Member ordering, Calculated Members

8. Script for Backing Up?

9. Member key/member name in calculated member builder

10. Dimension Member Name & Dimension Member ID

11. Filter dimension members based on current dimension member

12. Filter dimension members based on Current dimension member

13. Calculated Member using Member Properties