Linking date dimension from two different cubes - ssas

I have two cubes
Computer Engineering
Environmental Science.
Both cubes have a same Date dimension.
I have two scorecards, each for Computer Engineering and Environmental Science as shown in following figure. I would like to have a result as shown in the figure.
I have a drop down filter which uses Date dimension from Computer Engineering cube. This filter works perfectly for filtering KPIs of Computer Engineering Scorecard since Date dimension and measures are from same cube. But it is not able to filter KPIs from Environmental Science cube because the Date dimension in filter and measures in KPIs are from two different cubes.
I have tried following ideas.
LinkMember - LinkMember MDX function can get equivalent member from different dimension but within the same cube. It is limited to only one cube.
LookupCube - By using a LookupCube MDX function on first cube, I am able to get the measures of second cube on it. But these measures don't pivot over Date dimension from first cube.
Linked Objects - I added measures from second cube to the first cube as linked objects, but it did not create dimension usage relationship with Date dimension from first cube. Thus unviable.
I don't want to create a gigantic single cube.
Please help me suggest a solution or work around. Thanks in advance.

I'm wondering why Linked Objects didn't help. Let's create everything step by step.
Here is structures of two cubes, which I used:
Virtual cube creation:
The major disadvantage of this method:
You can't just add a measure to one of cubes, which are used in a Virtual cube.
You have to re-link the cube to avoid this error.
Hope this information helps.

Related

SSAS Data Source View Relationship

I need to get all the relationships in my SSAS cube Data Source View between Fact and Dim tables. I've around 15 Fact tables and linked dimensions to it. Is there any MDX query to get the relationship other then doing it manually
I suspect that you want to export a list of relationships between measure groups and dimensions as they are represented in the Dimension Usage tab of the cube designer. (The relationships in the DSV don't much matter unless SSAS needs to figure out how to join two tables in a SQL query it generates. You can have a cube with no DSV relationships at all. As long as the Dimension Usage tab has the right relationships then the cube will work.)
So please install the free BI Developer Extensions and run the Printer Friendly Dimension Usage Report. I believe it will contain the info you need.
I would recommend the above. If you want to look at the appropriate data management view (DMV) run the MDSCHEMA_MEASUREGROUP_DIMENSIONS DMV. It is harder to use and interpret but has what you need in terms of representing the Dimension Usage tab:
Select * from $system.MDSCHEMA_MEASUREGROUP_DIMENSIONS

SSAS MDX Calculation for SUM(DISTINCT COUNT)

Just to give you an overview I am very new at SSAS cubes and MDX Calculations in general. I'm currently having a hard time grasping the concept of querying an OLAP Cube.
So say I have a Movement Dimension with a unique key MovementID. I'm trying to create a calculation in SSAS that counts The total different MovementIDs in this dimension. So a few questions
Can I create this using the New Measure option in SSAS? It throws me an error if there is a MovementID in the dimension that is not present in my fact table so I'm trying to instead do this in MDX Calculation. Is my understanding here correct?
How do I make this script in MDX SSAS Calculation? The SQL equivalent should simply be SELECT COUNT(PFNo) FROM Dim_Movement. I know that the OLAP query works on axes rather than traditional table format. So how can I achieve a simple DISTINCT COUNT of a column in MDX script?
If I were to make the script to compute the SUM of the DISTINCT COUNT of the column instead. What would the script look like?
Thanks!

How are OLAP-cube operations and MDX related?

I would like to understand how OLAP-cube operations (i.e. drilling up/down, slicing/dicing and pivoting) and MDX are related.
My current guess is that OLAP-cube operations to MDX are like relational algebra to SQL. However, I do not see how some basic features of MDX correspond to OLAP-cube operations. For example, consider the following query on the demo "Sales" cube that comes with icCube:
SELECT {([Ottawa],[2009]), ([United States],[Feb 2010])} on Rows,
[Measures].members on Columns
FROM [Sales]
How does the use of tuples (e.g. ([Ottawa],[2009])) correspond to an OLAP-cube operation?
Yes, "OLAP-cube operations are what visualization tools are expected to implement". MDX is the query language that is executed against a cube that produces a result. OLAP clients generally run MDX against a cube. "OLAP cube operations" as described in that wikipedia are usually as a result of a person performing adhoc analysis against a cube in an client application.
Cube provide a structure and an access language that usually makes these types of operations easier (or at least faster)
How does MDX relate to a "drill down" operation? for example?
Firstly some MDX has already been run and yielded some kind of view of the cube (generally some rows, some columns, and a measure in the intersection although the MDX language syntax doesn't limit to two axes only).
So a person sees this information and decides to drill down on a single item in the row (this item was previously returned by some MDX). So the OLAP client generates some MDX that provides the drilled down view on the item
It might just add a children MDX function to the item in question. Or it might do it some other way. It depends on the client.
Heres some introductory info on how you can eavesdrop on the interactions between an OLAP client (which one? doesn't matter) and a SSAS cube
https://learn.microsoft.com/en-us/sql/analysis-services/instances/introduction-to-monitoring-analysis-services-with-sql-server-profiler
You can think of the MDX query specifying areas or regions of space within a cube - the tuple is a primary way of giving the processor co-ordinates which correspond to the part of the cube you are interested in.
It is the intersection of the co-ordinates and slices you specify that give you a result.
MDX is strongly related to set theory as the main types withing the cube are dimensions, sets, tuples, members etc.
An MDX query defines a table and for each of the table cell we've a tuple. In your scenario assuming we've two measures ( Meas1, Meas2 ) :
([Ottawa],[2009],[Meas1]) ([Ottawa],[2009],[Meas2])
([United States],[Feb 2010],[Meas1]) ([United States],[Feb 2010],[Meas2])
On this cell tuples you might add the WHERE clause, the SubQuery and the defaults that might be different than ALL (not advised). Remember all is a 'special' member that is ignored.
A tuple defines a single measure, Meas1 or Meas2, this will select the 'fact table' with a measure column, usually a numerical value. The other members are used to select rows in the table performing on them the aggregation defined by the measure ( sum , min, max.... ) on all rows defined by the tuple members, Ottawa and 2009 for example. As whytheq explains, you've a lot of transformations to 'play' with members as you would with sets.
This is the simple vision, as you can use calculated members that define a transformation instead of a simple row aggregation (e.g. Difference with previous year) and some aggregations are a bit more tricky ( open, close...).
But if you understand this well you got a perfect ground to understand MDX.

SSAS MDX Query not filtering dimensions based on roles

I have a windows application showing business intelligence and analysis data through MDX queries running on cubes in ssas.
In this way, I have added roles to Cubes with dimension data filtering but some mdx queries are not filtering data like mdx queries without any dimension as shown below.
SELECT NON EMPTY { [Measures].[Sales Amt] } ON COLUMNS FROM [SalesCube]
The above query is not showing data as per the dimensions filtered in dimension data of the role.
But queries having dimensions are filtered.
Please let me know how to handle this scenario.
You should check "Enable Visual Totals" to allow role mdx to be applied to all kind of queries, even not specifying dimension itself
Check your role - Dimension data - Advanced, at the bottom

SSAS first cube with facttable, is kinda hard

Link to DCD: http://i48.tinypic.com/29de538.png
I have this DCD to work on, with SQL Server Business Intelligence Development Studio 2008.
I have made a facttable which is a view, because I need to have some measures..
Now how do I connect my facttable to the other tables? Dont know if the should be linked to selftest, instrument or network.
It would be great to hear the correct linking, and how to do it!
Thanks a bunch!
It looks like you have Instrument (first dimension), execution date (second dimension) and a resulting status (third dimension) for each Self Test. You may generate hierarchies of Instrument Type, Group and Network to group together Instruments within ssas.
The resulting counts (NumOk, NumWarning, NumError) may be your measures. Typically, you would group these together depending on the grain of your fact (i.e. daily) to a single fact table. There is no need to create separate facts per measures, you would only create separate fact tables if the measures relate to a different set of dimensions
Try to set your source up as follows (add additional attributes as required) and follow the model through to the DSV. Suggest that you ignore hierarchies until you get the basics working within SSAS.