dbTalk Databases Forums  

how to get a properties of another dimension?

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


Discuss how to get a properties of another dimension? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tong via SQLMonster.com
 
Posts: n/a

Default how to get a properties of another dimension? - 08-27-2005 , 08:31 AM






WITH
MEMBER [Measures].[Store Type] AS '[Store].CURRENTMEMBER.PROPERTIES
("Store Type")'

SELECT
{ [Measures].[Store Type] , [Measures].[Employee Salary] } ON COLUMNS,
{ [Employees].[All Employees].[Sheri Nowmer].[Derrick Whelply].[Beverly
Baker].[Shauna Wyro].[Bunny McCown].CHILDREN } ON ROWS
FROM [HR]


hello:
i want to get a "Store Type" property of every employee, upon is my code ,
but the result look like this:
Store Type Employee
Salary
---------------------------------------------------------------------
Wanda Hollar #ERR 39.94
Nancy Miler #ERR 70.20

how can i get the right "Store Type" of every employee?

Reply With Quote
  #2  
Old   
mike
 
Posts: n/a

Default RE: how to get a properties of another dimension? - 08-29-2005 , 10:24 AM






you need to have the store set included in your select: this is not exactly
what you want but you can run it and hopefully this will get you closer to
what you want.

WITH
MEMBER [Measures].[Store Type] AS
'[Store].CURRENTMEMBER.PROPERTIES("Store Type")'

SELECT
non empty { [Measures].[Store Type] , [Measures].[Employee Salary] } ON
COLUMNS,
{ nonemptycrossjoin({Descendants([Employees].[All Employees].[Sheri
Nowmer].[Derrick Whelply].[Beverly Baker].[Shauna Wyro].[Bunny McCown],1)} ,
{[Store Type].Members}) } ON ROWS
FROM [HR]

"tong via SQLMonster.com" wrote:

Quote:
WITH
MEMBER [Measures].[Store Type] AS '[Store].CURRENTMEMBER.PROPERTIES
("Store Type")'

SELECT
{ [Measures].[Store Type] , [Measures].[Employee Salary] } ON COLUMNS,
{ [Employees].[All Employees].[Sheri Nowmer].[Derrick Whelply].[Beverly
Baker].[Shauna Wyro].[Bunny McCown].CHILDREN } ON ROWS
FROM [HR]


hello:
i want to get a "Store Type" property of every employee, upon is my code ,
but the result look like this:
Store Type Employee
Salary
---------------------------------------------------------------------
Wanda Hollar #ERR 39.94
Nancy Miler #ERR 70.20

how can i get the right "Store Type" of every employee?


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

Default Re: how to get a properties of another dimension? - 08-29-2005 , 10:55 AM



Looking at the schema of the Foodmart HR Cube, Store is really a
"Reference" dimension in AS 2005 terms, derived from the Employees
dimension. But in AS 2000 it is simply configured as a standard
dimension. One way to infer the relationship between an employee and the
corresponding store
is via the cube itself, using NonEmptyCrossJoin(), since data for a
given employee will only "exist" for that store:

Quote:
WITH
MEMBER [Measures].[Store Type] AS
'Tail(NonEmptyCrossJoin(
[Store].[Store Name].Members, {[Employees].CurrentMember}, 1))
..Item(0).PROPERTIES("Store Type")'

SELECT
{ [Measures].[Store Type] , [Measures].[Employee Salary] } ON
COLUMNS,
{ [Employees].[All Employees].[Sheri Nowmer].[Derrick
Whelply].[Beverly Baker].[Shauna Wyro].[Bunny McCown].CHILDREN } ON
ROWS
FROM [HR]
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.