Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts

Thursday, March 8, 2012

AS2005 Member Properties - MDX Query

Hi,

I am having a bit of a problem with retreiving member properties from our AS2005 cube. I'm using MDX query's in a VBA Excel app via ADO (not ADOMD). I've been prototyping the queries in the SQL Server Management Studio.

I currently have the following query:

WITH

MEMBER [Measures].[Portfolio] AS '[Trade].[Trade By Source System].CurrentMember.Properties("Portfolio")'

SELECT NON EMPTY {

[Measures].[Portfolio],

[Measures].[CR 01 Net Skw Adj USD],

[Measures].[JTD 01 USD]

} ON COLUMNS,

NonEmpty(Exists({[Trade].[Trade By Source System].[Trade Id].MEMBERS},[Trade].[Trade By Source System].[Source System].&[Calypso]))

ON ROWS

FROM [GCD]

WHERE ([Close Date].[Close Date].[Day].[01 Dec 2006], [Trade].[Trade By Business Unit].[Book Group].[LNCT])

This works fine, however I now want to CrossJoin the measures [CR 01 Net Skw Adj USD] and [JTD 01 USD] with a dimension called CS Tenor in order to give me a seperate value for each Tenor.

So far the only way I can do this is with the following query:

WITH

MEMBER [Measures].[Portfolio] AS '[Trade].[Trade By Source System].CurrentMember.Properties("Portfolio")'

SELECT NON EMPTY {

[Measures].[Portfolio],

[Measures].[CR 01 Net Skw Adj USD],

[Measures].[JTD 01 USD]

} * {[CSTenor].[CS Tenor].MEMBERS}

ON COLUMNS,

NonEmpty(Exists({[Trade].[Trade By Source System].[Trade Id].MEMBERS},[Trade].[Trade By Source System].[Source System].&[Calypso]))

ON ROWS

FROM [GCD]

WHERE ([Close Date].[Close Date].[Day].[01 Dec 2006], [Trade].[Trade By Business Unit].[Book Group].[LNCT])

This has the unfortunate side effect of CrossJoining the Portfolio member property with Tenor as well, resulting in 9 unwanted Portfolio columns (there are 9 members in CS Tenor). In reality the problem is more severe as I have around 10 member properties in the query, I reduced it to 1 here for simplicity.

My question is: Can I bring back member properties on the Rows axis? and a seperate question is: Can I CrossJoin some measures and not other on the columns axis, for example, could I CrossJoin [CR 01 Net Skw Adj USD] with CS Tenor, but not [JTD 01 USD] ?

Many thanks!

I don't believe you can cross join some measures and not other on the column axis but assuminng portfolio is an attribute of your Trade dimension the you can try this on your rows axis:

NonEmpty(Exists({[Trade].[Trade By Source System].[Trade Id].MEMBERS},[Trade].[Trade By Source System].[Source System].&[Calypso],strtomember("[Trade].[Portfolio].[" + [Trade].[Trade By Source System].CurrentMember.Properties("Portfolio") + "]") ))

Hope this helps.

V

|||

Actually, you should be able to do what you want on the column axis by simply constructing the full set of tuples that you want back. Here's an example from Adventure Works:

select

{ [Date].[Calendar Year].Members } on rows,

{ { [Measures].[Internet Sales Amount] } * { [Product].[Category].Members }, ( [Measures].[Internet Gross Profit], [Product].[Category].[All Products] ) } on columns

from

[Adventure Works]

In this query, I'm just pulling back calendar years on rows. On the columns, I'm pulling back the [Internet Sales Amount] measure cross joined with the product categories along with the [Internet Gross Profit] measure -- but with it coming back only with [All Products], not all the product cateogries. The only caveat is that all the tuples returned have to have the same dimensionality. Thus the need to return [Internet Gross Profit] with a member (in this case, the [All Products] member) of the same hierarchy used in the cross join that generates the first set of tuples.

In your case, you'd want something like this (not knowing exactly what your [All] member is, I just called it [All CS Tenors]):

{ { [Measures].[CR 01 Net Skw Adj USD] * [CSTenor].[CS Tenor].Members }, ( [Measures].[JTD 01 USD], [CSTenor].[CS Tenor].[All CS Tenors] ) } on columns

HTH,

Dave Fackler

|||

Hi,

Sorry for the delay in replying, I've been on vaction.

Many many thanks for this solution, it works perfectly!

Happy New Year,

Stuart

Monday, February 13, 2012

arithmetic overflow error

When attempting to view the properties of a database in SQL Server Management
Studio we are getting an error dialog that states the following.
Cannot show requested dialog.
Arithmetic overflow error converting expression to data type int (Microsoft
SQL Server, Error:8115)
Below is client version info
Microsoft SQL Server Management Studio9.00.3042.00
Microsoft Analysis Services Client Tools2005.090.3042.00
Microsoft Data Access Components (MDAC)2000.085.1117.00
(xpsp_sp2_rtm.040803-2158)
Microsoft MSXML2.6 3.0 4.0 5.0 6.0
Microsoft Internet Explorer7.0.5730.11
Microsoft .NET Framework2.0.50727.42
Operating System5.1.2600
Server version is 9.0.3054.
The size of the database on disk is in excess of 30TB which, I suspect, is
largely the cause. Any help is appreciated.
Sounds like the db size is the culprit. If so it is most likely a bug and
some poor coding on the developers part. I would post a bug on connect.
www.connect.microsoft.com
Andrew J. Kelly SQL MVP
"mike padula" <mikepadula@.discussions.microsoft.com> wrote in message
news:207536F9-64DF-4937-96C6-7D30C5D920ED@.microsoft.com...
> When attempting to view the properties of a database in SQL Server
> Management
> Studio we are getting an error dialog that states the following.
> ----
> Cannot show requested dialog.
> Arithmetic overflow error converting expression to data type int
> (Microsoft
> SQL Server, Error:8115)
> Below is client version info
> Microsoft SQL Server Management Studio 9.00.3042.00
> Microsoft Analysis Services Client Tools 2005.090.3042.00
> Microsoft Data Access Components (MDAC) 2000.085.1117.00
> (xpsp_sp2_rtm.040803-2158)
> Microsoft MSXML 2.6 3.0 4.0 5.0 6.0
> Microsoft Internet Explorer 7.0.5730.11
> Microsoft .NET Framework 2.0.50727.42
> Operating System 5.1.2600
> Server version is 9.0.3054.
> The size of the database on disk is in excess of 30TB which, I suspect, is
> largely the cause. Any help is appreciated.
|||Thanks Andrew, I posted something on MS Connect about 3 weeks ago. Nobody
seems to have given it much notice quite yet. Nonetheless, I've just edited
it to try to provide some additional information. We're also getting the
error when we try to generate DDL scripts for database objects (tables and
such)...
We also think it's a bug, related to the DB size as we do not get this error
on the same server when using the same client conected to a smaller database.
But, it may not be a "client" problem...because we get the same error when we
run sp_helpdb...that is:
Msg 8115, Level 16, State 2, Line 1
Arithmetic overflow error converting expression to data type int.
The statement has been terminated.
"Andrew J. Kelly" wrote:

> Sounds like the db size is the culprit. If so it is most likely a bug and
> some poor coding on the developers part. I would post a bug on connect.
> www.connect.microsoft.com
>
> --
> Andrew J. Kelly SQL MVP
> "mike padula" <mikepadula@.discussions.microsoft.com> wrote in message
> news:207536F9-64DF-4937-96C6-7D30C5D920ED@.microsoft.com...
>
>
|||You can also call MS PSS. It will cost about $200 or so to get in but if it
is a bug they will refund all your money.
Andrew J. Kelly SQL MVP
"mike padula" <mikepadula@.discussions.microsoft.com> wrote in message
news:98DBE125-4062-4AE7-A294-0B1811FB65C9@.microsoft.com...[vbcol=seagreen]
> Thanks Andrew, I posted something on MS Connect about 3 weeks ago. Nobody
> seems to have given it much notice quite yet. Nonetheless, I've just
> edited
> it to try to provide some additional information. We're also getting the
> error when we try to generate DDL scripts for database objects (tables and
> such)...
> We also think it's a bug, related to the DB size as we do not get this
> error
> on the same server when using the same client conected to a smaller
> database.
> But, it may not be a "client" problem...because we get the same error when
> we
> run sp_helpdb...that is:
> Msg 8115, Level 16, State 2, Line 1
> Arithmetic overflow error converting expression to data type int.
> The statement has been terminated.
>
> "Andrew J. Kelly" wrote: