I have a fact table containing lines of different types. Based upon each type I have a different dimension table that I need to connect. Is there a solution to this problem without creating different fact tables for each type of line?
When connecting the fact to one dimension, I get the error that one key cannot be found in the dimension table. That's right, because that value exists in another dimension table
Here a picture of what I intend to achieve:
Related
I have two data providers. One is a universe, one is an excel file. Excel file has column ID. I want to find ID,JOB_ID, Cost
I have created a merged dimension:- ID. When I create report with ID and Cost, I'm getting an outer joined result which is what I want. But when I add another attribute from universe it is being inner joined result. Where can I control this feature
You are ever so close. Here are the basics when working with a zero or one to many relationships. Credit for this goes to this blog post. I am copying it here if perchance that link goes dead.
As a rule of thumb , when trying to merge DP’s with a 1xN relationship
:
Merge the common fields
Use the dimension coming from the N side query
Create detail variables from the 1 side query for each dimension needed with associated dimension equal the merged dimension
Check "Show rows with empty dimension values" on Table formatting for each table using dimensions coming from both queries.
Here is a screen shot to highlight where to find the setting in step #4.
We have a data warehouse that contains a large fact table with over 100 million rows. I'm trying to create a cube that includes this fact table and need to create a fact dimension based off of this table. The issue that I'm running into is that there is no way to find uniqueness on this table using the fields that would be included in the fact dimension, without using every field in the table.
I created a surrogate key in the dsv using:
Row_Number() OVER (ORDER BY ID, Dt, Num)
I've used this method to create a surrogate key in another dsv and it worked, but I was also able to find uniqueness with the fields in the Order By.
When I browse the cube based on this fact table I get the correct results when using regular dimensions. When I try to use fields from fact dimension I get eroneous results in most cases...some are correct, though very few.
Would this be a case where I should request that a surrogate key get created on the fact table? Is there a better solution that someone could suggest?
We are having a very frustrating problem with SSAS. we are trying to create a fairly simple Tabular model have had no problem with a few dimensions and a single fact table. when we recently added a new dimension table, and a second fact table we can not get it to stop telling us that
The relationship cannot be created because each column contains duplicate values.
we have deleted and reimported these tables many times. at times we can attach the Dim table to an existing fact without problem, which tells me that the key is unique, but then it errors when attaching to a second fact. at other times it just errors right away.
The key and Foreign Key values are Int in the database. and we have examined the data many times, creating stripped down tables with just a few columns, validating that a
Select Distinct ID from Table
type query returns the same number of rows as a wide open one.
At this point it looks like we simply have a bug in SSAS Tab. I cant see a good reason for this to not work.
any ideas would be greatly appreciated
I have had the same problem, the way I solved is to create the relationship in reverse order meaning: from the 1 to many. This will solve the issue, and the relationship's direction will indeed be from the many to the 1
I do not have any explanation for this...
sometimes SSAS cannot detect that your column is unique so you should do that. you can click on your primary key column and get properties and choose true on the unique property and after that create your relationship
I have three tables, one fact and two dimensions. I want to make a referenced relationship between the fact table(measures) called InternetSales and the Geography table, se image(schemaCubeStructure".
The intermediate table is Customer. I first create the Geography and InternetSales tables and then the Customer with a field from Geography to use later when creating the ref. rel.
Everything works fine until browsing the data in the cube (se image "errorBrowseSalesCube". If i don´t make the relationship between the two tables i get image "correctBrowseSalesCube" which is what i want. That is i don´t get any data when processing with the rel.ref.
See image "dimensionUsageSalesCube for rel.ref.
Why is that i don´t get any data?
correctBrowseSalesCube
errorBrowseSalesCube
dimensionUsageSalesCube
schemaCubeStructure
What fields did you use when setting up your reference dimension relationship between Georgaphy and Internet Sales?
The in the AdventureWorksDW database, the Georgaphy dimension is a snowflake off of Customer dimension. In the AdvWrks cube project, Microsoft includes the geography table and corresponding attributes in the customer ssas dimension (red boxes in screenshot below). However, they could have, as it looks like you are trying to do, simply added the GeographyKey to the customer dimension (red arrow in screenshot below)
This exposes the GeorgaphyKey field when creating the reference dimension relationship so that you can properly define the relationship between the intermediate dimension (customer) and the reference dimension (geography):
After that, you can properly browse the Internet Sales facts by Georgraphy dimension attribute (and user) hierarchies:
The correctBrowse sales cube can be easily explained. It means that the data is not calculated based on the Geography dimension and thus indicates that the connection between the Internet sales and the Geography is not correctly calculated.
I would suggest the following:
Try making the customer a Mesaure (or fact table). Do not rename it just make a measure i.e. the count of customers (can be used as a counter of customers/per region or can be invisible altogether).
Then The customer will appear as a measure in Dimension usage and then connect Geography to Internet sales via a many to many relation Using the customer measure table.
I was just wondering if there could be any fact table, the keys of which don't belong to any of the dim tables? However, the fact table seems to contain the dim data.
The reason I came up with this question is that I was looking into a package which uses a dim table and fact table to pull data from, manipulate and them dump into the fact table. But, when I was trying to find any dependencies on the fact table (in the DSV ADD/Remove tables dialog box, I added the fact table, and then when I clicked on related tables, there was none)
And my claim is that the fact table gets some of its data from the dim tables.
Correct me if I am wrong.
Does your Fact table have columns which contain dimension keys, but are not constrained with a foreign key? I assume SSAS uses the foreign keys to identify related tables, so in this case, it wouldn't detect those tables. You can add related tables manually.
Another possibility is that the Fact table contains all the dimensions internally in a denormalized form. Rather than having dimension tables and keys to dimension members, all the data is stored in string form in the Fact table. If this is the case, you can create dimensions from the columns in the Fact table.
Is the fact table a table or named query?