dbTalk Databases Forums  

MDX Ratios

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


Discuss MDX Ratios in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Shiangoli via SQLMonster.com
 
Posts: n/a

Default MDX Ratios - 11-16-2004 , 11:21 AM






Hello All

Please may I have your assistance with the following query.
My objective is to return the utilisation (calculated member) which is the volume divided by the sum for a particular slice (based on a date). I'm rather new to MDX and my apologies for my ignorance. I've included comments in the query to explain what I'm doing.
Any help would be greatly appreciated.
I have a feeling that I'm using the SUM function incorrectly??..I'm not sure
Thanks
John

with
/*
define our set 'top servers' (top 10) for the month 1/7/2004 based on their volume (bytes)
*/
set [TOP SERVERS] as
'TopCount([Server].[Device Name].Members, 10,( [Measures].[bytes], [time].[m].[01/07/2004]))'
/*
define a calculated member to return the utilisation over all the servers for the above date . Hence the bytes for
****This is the bit I cannot get correct!!***********
I consistently return 1 for my utilisation
*/
member [measures].[utilisation] as
'([Measures].[bytes],[time].[m].[01/07/2004])/SUM({([Measures].[bytes],[time].[m].[01/07/2004])})'

/*
My select query, which would work ok if I was using bytes
*/
select
CrossJoin({[time].[m].[01/05/2004]:[time].[m].[01/10/2004]},{ [measures].[utilisation]}) ON COLUMNS,
{[TOP SERVERS]} on rows
FROM NVServer
where ([device Group].[All device Group])

*****************************************
* This message was posted via http://www.sqlmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse....edb1397abdb1e3
*****************************************

Reply With Quote
  #2  
Old   
John Shiangoli via SQLMonster.com
 
Posts: n/a

Default Re: MDX Ratios - 11-16-2004 , 05:03 PM






I need to make my calculated member dynamic. I tried the following

member [measures].[utilisation] as
'([Measures].[bytes],[time].[m].CurrentMember)/([Measures].[bytes],[time].[m].CurrentMember,[Server].[All Server])'

however I get the error 'Unable to open cell set formula error - cannot bind unknown dimension "[time].[m]"

I know the .[m] is a level and if I use

'([Measures].[bytes],[time].[m].[01/07/2004])/([Measures].[bytes],[time].[m].[01/07/2004],[Server].[All Server])'

it works.
however need to make the above dynamic so that it works with my crossjoin range 01/05/2004 to 01/10/2004

*****************************************
* A copy of the whole thread can be found at:
* http://www.sqlmonster.com/Uwe/Forum....rver-olap/4615
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse....155ddb4c81341f
*****************************************

Reply With Quote
  #3  
Old   
Deepak Puri
 
Posts: n/a

Default Re: MDX Ratios - 11-16-2004 , 10:00 PM



You don't need to explicitly specify the dimension current member, so
this version of [utilisation] should work:

Quote:
member [measures].[utilisation] as
'([Measures].[bytes])
/([Measures].[bytes],[Server].[All Server])'

Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #4  
Old   
John Shiangoli via SQLMonster.com
 
Posts: n/a

Default Re: MDX Ratios - 11-17-2004 , 04:57 AM



I was making this too complicated. The following worked

member [measures].[utilisation] as
'([Measures].[bytes])/([Measures].[bytes],[Server].[All Server])'

*****************************************
* A copy of the whole thread can be found at:
* http://www.sqlmonster.com/Uwe/Forum....rver-olap/4615
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse....b2929803b0442b
*****************************************

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.