dbTalk Databases Forums  

Creating calculated members to correctly total percentage calculations

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


Discuss Creating calculated members to correctly total percentage calculations in the microsoft.public.sqlserver.olap forum.



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

Default Creating calculated members to correctly total percentage calculations - 08-15-2005 , 10:16 AM






I have a calculated member which calculates a percentage by dividing
Measure A by measure B.
I wish to display this with other, regular, measures in a grid (we use
Proclarity professional as our front end client)with another dimension
on the rows and be able to subtotal all the measures on the bottom row.
I cannot use ProClarity's built in subtotal functionality as it will
just add up the percentages in the same way it adds up the normal
numeric measures.
I thought I would be able to create a calculated member to do the
subtotalling, using an IIF statement to pick up when the measure is the
calculated percentage and summing the rest, but cannot get it to work.
Would anyone advise what the best method would be please?
Thank you
Rachel


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

Default Re: Creating calculated members to correctly total percentage calculations - 08-15-2005 , 11:28 AM






What value would you want to bottom row to hold for the calculated measure?

"rachel" <rachel.jones (AT) talbotuw (DOT) com> wrote

Quote:
I have a calculated member which calculates a percentage by dividing
Measure A by measure B.
I wish to display this with other, regular, measures in a grid (we use
Proclarity professional as our front end client)with another dimension
on the rows and be able to subtotal all the measures on the bottom row.
I cannot use ProClarity's built in subtotal functionality as it will
just add up the percentages in the same way it adds up the normal
numeric measures.
I thought I would be able to create a calculated member to do the
subtotalling, using an IIF statement to pick up when the measure is the
calculated percentage and summing the rest, but cannot get it to work.
Would anyone advise what the best method would be please?
Thank you
Rachel




Reply With Quote
  #3  
Old   
Elad
 
Posts: n/a

Default Re: Creating calculated members to correctly total percentage calculations - 08-15-2005 , 11:44 AM



Is this what you're looking for? (Against FoodMart 2000):

WITH MEMBER [Measures].[New Measure] AS '[Measures].[Profit] /
[Measures].[Unit Sales]' MEMBER [Customers].[SubTotal] AS
'SUM({[Customers].[State Province].&[CA],[Customers].[State
Province].&[OR],[Customers].[State Province].&[WA]})'

SELECT { [Measures].[Profit], [Measures].[Unit Sales], [Measures].[New
Measure] } ON COLUMNS , { [Customers].[State Province].&[CA],
[Customers].[State Province].&[OR], [Customers].[State Province].&[WA],
[Customers].[SubTotal] } ON ROWS FROM [Sales]


"rachel" <rachel.jones (AT) talbotuw (DOT) com> wrote

Quote:
I have a calculated member which calculates a percentage by dividing
Measure A by measure B.
I wish to display this with other, regular, measures in a grid (we use
Proclarity professional as our front end client)with another dimension
on the rows and be able to subtotal all the measures on the bottom row.
I cannot use ProClarity's built in subtotal functionality as it will
just add up the percentages in the same way it adds up the normal
numeric measures.
I thought I would be able to create a calculated member to do the
subtotalling, using an IIF statement to pick up when the measure is the
calculated percentage and summing the rest, but cannot get it to work.
Would anyone advise what the best method would be please?
Thank you
Rachel




Reply With Quote
  #4  
Old   
Elad
 
Posts: n/a

Default Re: Creating calculated members to correctly total percentage calculations - 08-15-2005 , 11:50 AM



Oh - the difference between this MDX and the MDX generated by ProClarity is
in the solve_order.

"Elad" <EladZZZ7690 (AT) hotZZZmail (DOT) com> wrote

Quote:
Is this what you're looking for? (Against FoodMart 2000):

WITH MEMBER [Measures].[New Measure] AS '[Measures].[Profit] /
[Measures].[Unit Sales]' MEMBER [Customers].[SubTotal] AS
'SUM({[Customers].[State Province].&[CA],[Customers].[State
Province].&[OR],[Customers].[State Province].&[WA]})'

SELECT { [Measures].[Profit], [Measures].[Unit Sales], [Measures].[New
Measure] } ON COLUMNS , { [Customers].[State Province].&[CA],
[Customers].[State Province].&[OR], [Customers].[State Province].&[WA],
[Customers].[SubTotal] } ON ROWS FROM [Sales]


"rachel" <rachel.jones (AT) talbotuw (DOT) com> wrote in message
news:1124119004.629340.36900 (AT) f14g2000cwb (DOT) googlegroups.com...
I have a calculated member which calculates a percentage by dividing
Measure A by measure B.
I wish to display this with other, regular, measures in a grid (we use
Proclarity professional as our front end client)with another dimension
on the rows and be able to subtotal all the measures on the bottom row.
I cannot use ProClarity's built in subtotal functionality as it will
just add up the percentages in the same way it adds up the normal
numeric measures.
I thought I would be able to create a calculated member to do the
subtotalling, using an IIF statement to pick up when the measure is the
calculated percentage and summing the rest, but cannot get it to work.
Would anyone advise what the best method would be please?
Thank you
Rachel






Reply With Quote
  #5  
Old   
rachel
 
Posts: n/a

Default Re: Creating calculated members to correctly total percentage calculations - 08-16-2005 , 04:28 AM



Thank you for this - however, when I run this MDX in the sample
application I get an error for the subtotal - Infinite recursion
detected?
Rachel


Reply With Quote
  #6  
Old   
RuiDC
 
Posts: n/a

Default Re: Creating calculated members to correctly total percentage calculations - 08-16-2005 , 04:38 AM



Hi, i had this problem as well.

When Proclarity creates an automatic subtotal field, it uses a solve
order of 1000, so you need to make sure your percentage calculated
member has a higher solve order than 1000 and it should work fine.

R
rachel wrote:
Quote:
Thank you for this - however, when I run this MDX in the sample
application I get an error for the subtotal - Infinite recursion
detected?
Rachel


Reply With Quote
  #7  
Old   
rachel
 
Posts: n/a

Default Re: Creating calculated members to correctly total percentage calculations - 08-16-2005 , 05:30 AM



I wasn't using ProClarity for this - but anyway, I see the method, so I
created a measure that added together the set & member I am using on
the rows, and it works perfectly as a subtotal, so thank you very much
for that.
Rachel


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.