dbTalk Databases Forums  

MDX Sumproduct and excel functions

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


Discuss MDX Sumproduct and excel functions in the microsoft.public.sqlserver.olap forum.



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

Default MDX Sumproduct and excel functions - 03-21-2005 , 01:15 AM






Hi

Has anyone used SUMPRODUCT in a calculated member in analysis services?
Apparantly, according to MS documentation, its possible, but I can see
nothing in the books online - or on the web.

I am using the syntax below, which I would have thought would have worked.

SUMPRODUCT({[Accounts].&[123],[Accounts].&[456]},{[Accounts].&[111],[Accounts].&[321]})

So does anyone know how to use SUMPRODUCT with AS?

Thank you for your help

Jeremy

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

Default Re: MDX Sumproduct and excel functions - 03-22-2005 , 10:32 PM






Since the arguments to SumProduct() are arrays, use the MDX SetToArray()
function to generate them. The second argument to SetToArray() is the
numerical value to use:

Quote:
SUMPRODUCT(
SetToArray({[Accounts].&[123],[Accounts].&[456]},
[Measures].[Sales]),
SetToArray({[Accounts].&[111],[Accounts].&[321]},
[Measures].[Sales]))
Quote:

From SQL Server BOL>>
SetToArray

Converts one or more sets to an array for use in a user-defined
function.

Syntax

SetToArray(«Set»[, «Set»...][, «Numeric Expression»])

Remarks

This function converts one or more sets to an array for use in a
user-defined function. The number of dimensions in the resulting array
is the same as the number of sets specified.

The optional numeric expression can be used to provide the values in the
array cells. If omitted, the default value of the set member is used for
the array cell value.
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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.