SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX Returning Member Properties


MDX Returning Member Properties

Author
Message
Rooster
Rooster
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 Visits: 336
The following query returns a list of customers I am interested in:

select {[Measures].[Net Value]} on 0,
NON EMPTY [Customer].[Customer].[Customer].Members on 1
from (select (
[Transaction Date].[Date].&[2013-01-25T00:00:00]
) on 0 from [Invoice And Credits])


In my customer dimension I have several member properties which hold address information for the customers. I need to be able to include them in the results and have tried this:

with member [Measures].AddressLine1
as [Customer].[Customer].Properties( "Address Line 1" )

select {[Measures].[Net Value],AddressLine1} on 0,
NON EMPTY [Customer].[Customer].[Customer].Members on 1
from (select (
[Transaction Date].[Date].&[2013-01-25T00:00:00]
) on 0 from [Invoice And Credits])


This returns all customers in my dimension (see image attachment SSAS2.png) - How can I include the member property?
Attachments
SSAS2.png (13 views, 24.00 KB)
Mark Fitzgerald-331224
Mark Fitzgerald-331224
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4415 Visits: 1650
I think you are asking for the same rows values as the first query, without all the NULLs. The NON EMPTY instruction any row that contains at least 1 non null column. In you case the address line 1 fits that criteria so all customers are now valid.

If you change to use the NONEMPTY function instead then you can target a measure when checking for NONEMPTY values as below:


with member [Measures].AddressLine1
as [Customer].[Customer].Properties( "Address Line 1" )

select {[Measures].[Net Value],[Measures].AddressLine1} on 0,
NONEMPTY ([Customer].[Customer].[Customer].Members,
[Measures].[Net Value]) on 1
from (select (
[Transaction Date].[Date].&[2013-01-25T00:00:00]
) on 0 from [Invoice And Credits])


Fitz
Rooster
Rooster
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 Visits: 336
That's fixed it! Many thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search