dbTalk Databases Forums  

SUM MDX functions

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


Discuss SUM MDX functions in the microsoft.public.sqlserver.olap forum.



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

Default SUM MDX functions - 09-19-2003 , 01:24 AM







Please consider the following MDX query



WITH MEMBER [MEASURES].[NEW SUM] AS

'SUM(

[TIME].[MONTH].MEMBERS,

([TIME].[YEAR].[2003], [MEASURES].[SALES])

)'

SELET {[MEASURES].[NEW SUM]} ON COLUMNS,

[PRODUCT].[CATEGORY].MEMBERS ON ROWS FROM SALES





What should be the values of [NEW SUM]



Is it SUM of sales of each month



or



Is it sales of 2003 multiplied by number of months in time dimension.





This query is executing without error , Shouldnt it give an error that

"Only one member of a dimension is allowed in tuple"





Thanks



Asim Naveed.


--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: SUM MDX functions - 09-19-2003 , 11:06 AM






It will sum sales for 2003 -- an unnecessary calculation because you can
just query Sales for 2003. The first argument for the sum function is a set,
not a tuple, hence the rules for tuples aren't violated.

What are you trying to accomplish?

tom @ the domain below
www.tomchester.net


"asim73" <member31195 (AT) dbforums (DOT) com> wrote

Quote:
Please consider the following MDX query

WITH MEMBER [MEASURES].[NEW SUM] AS
'SUM(
[TIME].[MONTH].MEMBERS,
([TIME].[YEAR].[2003], [MEASURES].[SALES])
)'
SELET {[MEASURES].[NEW SUM]} ON COLUMNS,
[PRODUCT].[CATEGORY].MEMBERS ON ROWS FROM SALES

What should be the values of [NEW SUM]
Is it SUM of sales of each month
or
Is it sales of 2003 multiplied by number of months in time dimension.
This query is executing without error , Shouldnt it give an error that
"Only one member of a dimension is allowed in tuple"



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

Default Re: SUM MDX functions - 09-20-2003 , 07:18 AM




Actually I am trying to make a correlation matrix oF products dimension,

thats easy , but problem arises when I want to see it quarter wise and

the time break for correlation calculation is that quarter's months.

Consider 2 dimensions



TIME

PRODUCT



I made another dimension for product called PRODUCT2



Now I executed the following query to accomplish the below report.





WITH MEMBER [Measures].[CR] AS

'Correlation([TIME].CURRENTMEMBER.CHILDREN,

(Product.currentmember, product2.[all product2], measuers.sales),

(Product2.currentmember, product.[all product], measures.sales))'

SELECT

PRODUCT.CATEGORY.MEMBERS ON COLUMNS,

CROSSJOIN(PRODUCT2.CATEGORY.MEMBERS,

[TIME].[QUARTER].MEMBERS) ON ROWS

FROM SALES

WHERE [MEASURES].[CR]







P1 P2 P3

P1 Q1 1 .8 .5

Q2 1 .3 .2

Q3 1 .1 .65

Q4 1 .23 .25



P2 Q1 .8 1 .51

Q2 .3 1 .22

Q3 .1 1 .75

Q4 .23 1 .85



P3 Q1 .5 .51 1

Q2 .2 .22 1

Q3 .65 .75 1

Q4 .25 .85 1





The query is executing without error, but the result contains

correlations like 3.45, 2.34, -2.73 etc.



According to my knowledge correlations is between -1 and 1. it can

never be less than -1 or greater than 1.



How can I achieve this, I also tried by using TIME2 dimension

and LINKMEMBER but then it gives and error that

"the level name is not unique :month"



I hope you understand the problem, please reply urgently as this

is my assignment in my office and i am stuck with it



Thanks

Asim Naveed


--
Posted via http://dbforums.com

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

Default Re: SUM MDX functions - 09-20-2003 , 07:29 AM




P1 P2 P3



P1 Q1 1 .8 .5



Q2 1 .3 .2



Q3 1 .1 .65



Q4 1 .23 .25







P2 Q1 .8 1 .51



Q2 .3 1 .22



Q3 .1 1 .75



Q4 .23 1 .85







P3 Q1 .5 .51 1



Q2 .2 .22 1



Q3 .65 .75 1



Q4 .25 .85 1





Note that this is not the output of query, but my desired output,

the output of the query contains correlations less than -1 and

greater than 1



Thanks



Asim Naveed


--
Posted via http://dbforums.com

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

Default Re: SUM MDX functions - 09-21-2003 , 01:14 AM




Please reply or comment or ask for any clarification

TOM CHESTER, MOSHA etc specially you people please


--
Posted via http://dbforums.com

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.