Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

Help with dimension usage design

$
0
0

I am working on a cube to map supply and demand for labor assignments and after struggling with teaching myself I am stuck trying to wrap everything together. I think I have a flaw in my design that is probably obvious to those with more experience.

My fact table is for assignments and tracks the hours of an employee to a position in a project for a given month.

FactAssignment -> employeeid, yearmonth, hours, positionid, projectid

I created some pretty normal dimensions that I think are straight forward. The items that are bolded and underlined are part of the issue I will describe in a bit.

dimEmployee ->employeeid, employeename, employeetype, jobtitle, orgid, poolid

dimProject -> projectid, projecttype, customerid

dimPosition -> positionid, projectid, positionrole

dimAssignmentTime -> yearmonth

Where I think I have made the mistake is with the dimensions below.

dimPool -> poolid, parentpoolid, pooltype, poolregion (a pool is a grouping of employees by certain business rules and each emp belongs to 1 pool)

dimOrg -> orgid, parentorgid, orgtype (this is a typical organizational hierarchy)

These dimensions where made into hierarchies from flattened data. By flattened I mean that there is no parentID in the tables and instead the data is presented to me in levels (level1, level2, level3, level4 ... level10). It took me a while to figure out what to do but I found an article on the topic and used SQL coalesce to form the tree.

This results in two main issues. First I have no fact source for headcounts because my fact table is by hours. Second, I can't connect dimPool and dimOrg to the measure group of my fact table. I tried to resolve both issues with extra fact tables to get headcounts by pool and org.

FactEmployee -> employeeID, poolID, orgID, empCount

FactPool -> poolID, poolCount, empCount

This works for the headcount by pool and org but still does not solve the issue that dimPool and dimOrg cannot be linked to FactAssignment. 

One idea I had were to create cross reference queries that could be translated to hidden dimensions that would exist only to link up all the dimensions. I have a feeling this is not efficient. Another idea was to create the hierachies for pool and org inside the existing dimEmployee. Since FactAssignment is already tied to my dimEmployee I think this would sovle the issue but the attribute list for the employee dimension would be huge (10 levels for both pool and org would have to be added to the existing attributes for employee) and I wonder if that would hurt performance. Then again, I am not sure if this was the very reason why each dimension can have multiple hierarchies in the designer.

Before I went off trying these options I wanted to ask for opinions and see if there is a better method that is more obvious.


Viewing all articles
Browse latest Browse all 14337


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>