dbTalk Databases Forums  

Using a view with ROW_NUMBER (ORDER BY... as a Dimension

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


Discuss Using a view with ROW_NUMBER (ORDER BY... as a Dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rose
 
Posts: n/a

Default Using a view with ROW_NUMBER (ORDER BY... as a Dimension - 01-20-2006 , 04:01 AM






I need to create a REPORTING HIERARCHY that is multi-level for ad-hoc
reporting purposes through MSRS.

Take for example, an Organization hierarchy in the form of Head
Quarter->Regional HQ->Subsidiary->Stores

Due to the nature of the data, some levels can be NULL (e.g. a Regional
HQ without any subsidiaries and stores yet).

I am using a db view with ROW_Number to implement this Dimension in AS,
such as

CREATE VIEW [dbo].[vw_Entity_Hierarchy_by_Promoter]
AS
SELECT ROW_Number() OVER (ORDER BY vw.Org_Key, vw.Reg_Org_Key,
vw.Sub_Key, vw.Store_Key) AS Entity_Key, *
FROM (
SELECT DISTINCT o.Org_Key, r.Reg_Org_Key, b.Sub_Key, s.Store_Key,
o.Org_Name, etc...

as the ROW_NUMBER may be different each time if a new
store/subsidiary/regional HQ is added, I am worried that this may have
an impact on the Cube, as ROW_NUMBER is what I am using as the
Dimension Key for this. I dont really feel I am doing the things right
here.

Is there a better way to handle this?


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.