I've got a simple cube with a fact table which has a date field among others and connected it with a time dimension which has 2 hierarchies.
What I want to do is create one measure that will be filtered only by the one time hierarchy and a second one for the second time hierarchy.
Basically this:
Measure1 ----> Cannot be affected by filtering of time_hierarchy2 and gets filtered only by time_hierarchy1
And the same for Measure2.
With what I've tried so far I can't do this because whenever I add a time hierarchy in the cube browser filter area, it affects both measures while I want them to be independent.
Is this possible?
The idea is to create two instances (i.e Cube Dimensions) of your Database Dimension and put one Hierarchy in each of them. This concept is also known as a Role-Playing Dimension.
You can then add filters using these role-playing dimensions to filter your Measures.
In the way you have described your current data model this is not possible. Within Analysis Services if you were to review the Dimension Usage tab you will notice the dimension to measure group usage. For a single measure to dimension relationship the measure will be affected by all attributes/hierarchies of the related dimension when browsing the cube.
If a viable option would be to have a separate TimeKey in your fact you may establish a Role Playing Dimension and have multiple constraints from the your fact to Time dimension.
Another option could be similar to where I recently split this setup into multiple facts each with a single reference to the Time dimension so that I could the plot separate measures to the same graph on the same time axis. How to avoid Role Playing Dimension
Related
As of now in my fact table i have around 6 Date Keys which needs to be linked to one Date Dimension.
Possible solution on table with me is:
Creating multiple date dimension and linking it with Fact Table. As this involves duplicating the data. I wanted to avoid this solution as i have around 10 Date Columns in my fact Table.
I am looking for a solution in order to reduce the redundancy of number of Tables in my Model.
Something like User-Role
Without increasing the number of tables, we can use the relationship which is relevant to the measures. This can be achieved by enforcing the data model to activate the relationship we need. The relationship can be moved from inactive to active in DAX using USERELATIONSHIP function. Below are the snaps showing one active and 2 inactive relationships and usage of "USERELATIONSHIP" while implementing the measures and results later.
I am trying to somehow link two dimensions together in SSAS.
I have the following Dimensions:
Location
Price Scheme
Product
I have a fact and measure group that is linked through Product and Price Scheme (there are only about 3 price scheme members).
Price Scheme is also an attribute of Location.
I want my measure group to show up against each location. If in my source query I do a join to Location based on the Price Scheme, then I get about 100 million records which makes the cube processing take a long time. There is less than 1 million rows in the measure group when at the Sales Price Scheme level.
I suppose my question is: how do I write an MDX query that will get the measures from my measure group based on the Price Scheme of the attribute against the Location dimension?
I know I can do a referenced dimension.. but doesn't that just modify the query by performing an inner join onto the Location dimension and as such will still give me 100 million rows to process?
Simple OLAP rule: The less you process, the slower MDX you get.
There are two ways:
Use many-to-many relation: which is also slow and you need one more
extra fact table to join two dimensions.
Use Slow-changing dimension: which is super fast on your cube, but
will take some time to process. You may speed it up, by setting
indexes and ProcessingGroup property to ByTable. Roughly saying it's what you described above.
In order to say more we want to see your data scheme.
Can anyone please explain a database dimension and cube dimension in SSAS in simple terms? I have done my research and I am not sure I completely understand the differences between the two.
I assume you are developing an Analysis Services Multidimensional model in Visual Studio. That project represents a database. In that database are top level objects like data sources, data source views, cubes and dimensions. So the dimensions you put in the Dimensions folder in Solution Explorer are "database dimensions".
Next, when you construct a cube it contains measure groups and cube dimensions. The bottom left of the first tab of the cube designer lists the cube dimensions. Also the rows on the Dimension Usage tab list cube dimensions.
You can add a database dimension to a cube one or more times. For example, if you have a Date dimension defined as a database dimension then you can add it multiple times to the cube to make Order Date and Ship Date cube dimensions. These multiple copies of the dimension are called "role-playing dimensions".
The database dimension takes up storage space. The cube dimensions don't take up duplicate storage space for the dimension data. But measure groups are indexed by cube dimensions so each additional cube dimension will increase the index size in your cube.
The cube dimension is the role the data plays in your cube. The most frequently used is Date. You'll have multiple dates in your cube, Order Date, Hire Date, Termination Date, etc. Each of these 'role playing' dimensions acts the same and can contain the same attributes, but they differ in how they describe the relationship to the event you are looking at.
The database dimension is the storage for the cube dimension. There is only one Date database dimension and all of your cube Date dimensions will use the exact same copy of the data. All of the attributes used by your cube dimension are contained in the database dimension, even if the various cube role-playing dimensions do not each make use of all of the attributes. Changing data in the database dimension will change the data in all of the cube dimensions when the cube is next processed.
We have an "age" dimension in our SSAS Cube. It's basically just the one attribute that's the person's whole number age at the time an event happened. We've had a requirement to further break it down into adult/child with a sub group of adult/geriatric and pediatric/neonatal.
When adding these new attributes to the dimension and a hierarchy, do I have to go into the aggregation designs and rebuild the ones that reference the dimension?
We aren't changing the key of the patient age, just adding the extra data.
Unfortunately, you aggregations won't include new level automatically, but they will help anyway: engine can use lower than your new level aggregations of the same dimension as it's faster than retrieving from data files.
Please also remember '1/3 rule': aggregations should be less than 1/3 the size of the fact table.
You can see details in amazing white paper 'Analysis Services 2008 R2 Performance Guide' http://download.microsoft.com/download/6/5/6/6567C845-FC8D-4D62-920F-C027A349C889/SSASPerfGuide2008R2.pdf (3.4 Aggregations, page 60).
I have a date dimension that has identical attributes in several cubes.
How should I set this up
Have the dimension repeated in each cube
Make it a linked dimension from one cube to all the other cubes
Make a stand alone cube with just the date dimension and then have all the other cubes link to that one instance
Something else.
If the cubes are in the same database, you should just be able to add the dimension to each one. Do you have a single database holding all the cubes, or do they live in different databases?