Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Dimension - Accessing related Attributes Expand / Collapse
Author
Message
Posted Wednesday, November 13, 2013 10:55 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 9:57 AM
Points: 212, Visits: 732
Hi All

This must be a seriously stupid question for people well versed in Dimensions and Hierarchies so I hope to get a quick answer.

I have a simple Dimension called DimTagInstance which has 3 Attributes (Id, Site Id, Latitude, Longitude). I would like to be able to access the Value of the other Attributes when I am in the context of another one.

I have written the following query but it returns All for the Value.

WITH MEMBER
Measures.Latitude AS
[DimTagInstance].[Latitude].CURRENTMEMBER.Name


SELECT
{[Measures].[Count], Measures.Latitude} ON 0,
{[DimTagInstance].[Site Id].[Site Id]} ON 1
FROM
[Cube]

Any help would be great.

Cheers

Ludo
Post #1513993
Posted Thursday, November 14, 2013 3:50 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 3:43 AM
Points: 390, Visits: 701
It will show "All" because in your query you are specifying a different member.

So in the context of [DimTagInstance].[Site Id].[Site Id] the calculation [DimTagInstance].[Latitude].CURRENTMEMBER.Name will return "All" because you are not including the [DimTagInstance].[Latitude] members in the query. If you did something like
WITH MEMBER
Measures.Latitude AS
[DimTagInstance].[Latitude].CURRENTMEMBER.Name


SELECT
{[Measures].[Count], Measures.Latitude} ON 0,
{[DimTagInstance].[Site Id].[Site Id]} ON 1
FROM
[Cube]
WHERE
[DimTagInstance].[Latitude].&[whatever]

Then it would display the value of whatever.

CURRENTMEMBER is contextual to whatever query you are running so the fact that it displays "All" in your query is correct behaviour.

I hope that helps





I'm on LinkedIn
Post #1514208
Posted Thursday, November 14, 2013 5:18 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 9:57 AM
Points: 212, Visits: 732
Hi Paul

I managed to do it by using the Properties. Instead of using the "Site Id" I have used the Id which is the Key and called the "Location" Property.

Thanks for your help!!

Cheers

Ludo
Post #1514226
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse