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


Dimension - Accessing related Attributes


Dimension - Accessing related Attributes

Author
Message
Ludo-ZX7R
Ludo-ZX7R
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 789
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
PB_BI
PB_BI
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1966 Visits: 2517
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
Ludo-ZX7R
Ludo-ZX7R
Old Hand
Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)Old Hand (318 reputation)

Group: General Forum Members
Points: 318 Visits: 789
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
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