Cannot make a ConvertToUnknown dimension work on an SSAS OLAP cube - ssas

We have an SSAS OLAP cube with some dimensions defined as
KeyNotFound -> IgnoreError and
KeyErrorAction -> ConvertToUnknown
One of this dimensions (and only one) doesn't work as expected, when the fact table value is not found on the dimension the values are not considered.
In other words, this particular dimension acts as if it were defined as
KeyErrorAction->DiscardRecord
Looking at the detail log of the building process it's clear that the behaviour must be this one, as the select looks like (simplified)
Select fields_from_fact_table,dim_key
from fact_table,dim_table
where fact_table.value_key=dim_table.dim_key
A join like this one only returns records present on the dim_table and this is the reason we cannot see the non-existent values.
But we cannot see any reason why this occurs. Why this specific dimension and not another one? Using a join with a dimension defined as DiscardRecord would be logical (yes, there are some dimensions that could be choosed on our cube) but using one defined as ConvertToUnknown just defeats the declaration itself.
The only reason we can imagine is that this particular dimension is used as the intermediate dimension of another "referenced" dimension (unsure of the correct name in English, it's the case when the fact_table links to a dimension and this one to a second one).
If this was the case SSAS should warn with an error when you select the ConvertToUnknown method.
A diferent fact_table with diferent dimensions, uses also a join (no referenced dimensions here), so it seems a join is always used.
Any idea about what is happening? How can we make this dimension work as expected?

Wow! Discovered the reason by accident. This specific Dimension is used as an intermediate dimension for another one. In this situations you cannot have null values.

Related

Multiple Dimensions on one field in Fact Table

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:

SSAS 3 fact tables, but only 2 relate to a certain dimension

I have a cube with 3 fact tables and 20 + dimensions that relate easily to all 3 fact tables and everything works fine except for the fact that one of the dimensions (Warehouse) is only related to 2 of the 3 fact tables. My problem I guess is a display issue. When the user is viewing measures from all 3 fact tables then drags over the Warehouse dimension, it simply repeats the grand total of the measure in the 3rd fact table for every possible value of Warehouse. This certainly makes sense to me as there is no relationship set up and it's conceptually behaving almost like a cross-join. Nonetheless, it's confusing to users and I'd like to not have the grand total duplicated for each dimension member in Warehouse. I was thinking one solution was to create a dummy warehouse called "Not Applicable" and then relate every row in the 3rd fact table to that dimension member. I was hoping there's just a setting in SSAS where I could control this behavior so I didn't have to create any new warehouse values. Is there a standard way to handle non-related dimensions with multiple fact tables? Thanks in advance.
You can use the "IgnoreUnrelatedDimensions" property of the measure group not related to Warehouse: set it from the default value true to false. Then, measure values for this measure group will only be shown for the "All" members from the warehouse dimension, and the cells will be null (empty) for non-All members of this dimension.
This is a global setting per measure group, you cannot configure it individually per dimension and measure group. But for your purpose, this should be fine.

can´t make referenced relationship to work

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.

Analysis Services Error: 'table that is required for a join cannot be reached'

In SSAS I have three dimensions one of which relates to a fact table. When I process the dimension with attributes from each of the other two dimensions I get the above error.
There is definitely a join, between the main dimension and the other two dimensions. The primary key in the same dimension i.e book also relates to the other book foreign keys in the other dimensions.
If I script with two joins it works but SSAS doesn't seem to pick this up.
I have looked at previous posts and tried their recomendation but they are not appropriate for my issue it seems.
Have you refreshed your DSV ? From what i can remember this was usually caused by something going mishap in the DSV, so that the table or view used for the dimension wasn't accessible
Could you post your DSV? Last time I saw this error message, the table relationships were set up incorrectly in the DSV, causing a circular reference.
This error occurs due to selection of attribute from any other tabale/view instead of related one.
Go to dimension structure -> datasource view pane (center pane)
Right click and -> show related tables
Drag and drop field from table/view .
It should work fine.

Using "Fact" Relationship Type on the "Dimension Usage" tab in a SSAS OLAP cube

I was hoping someone could explain the appropriate use of the 'FACT Relationship Type' under the Dimension Usage tab. Is it simply to create a dimension out of your fact table to access attribute on the fact table itself?
Thanks in advance!
Yes, if your fact table has attributes that you would like to slice by (create a dimension from), you would use this relationship type.
Functionally, to the users it behaves no differently than a regular relationship.
After you create your dimensions and cubes you need to define how each dimension is related to each measure group. A measure group is a set of measures exposed by a single fact table.
Each cube can contain multiple fact tables and multiple dimensions. However, not every dimension will be related to every fact table.
To define relationships right click the cube in BIDS and choose open; then navigate to the Dimension Usage tab. If you click the ellipsis button next to each dimension you will see a screen that allows you to change dimension usage for a particular measure group. You can choose from the following options:
Regular default option; the dimension is joined directly to the fact table
No relationship the dimension is not related to the current measure group
Fact the dimension and fact are derived from a single table. If this is the case your dimensional warehouse has poor design and isn't likely to perform well. Consider separating fact and dimension tables.
Referenced the dimension is joined to an intermediate table prior to being joined to the fact table. Referenced relationship resembles a snowflake dimension, but is slightly different. Suppose you have a customer dimension and a sales fact; you'd like to examine total sales by customer, but you also want to examine line item sales by customer. Instead of duplicating the customer key in the line item fact table you can treat the sales fact as an intermediate table to join customer to line item.
Many-to-many this option involves two fact tables and two dimension tables. Dimension A is joined to an intermediate fact A, which in turn joins to dimension B to which the fact B is joined. Much like with fact option if you need to use many-to-many option your design could probably use some improvement. This type of relationship is sometimes necessary if you are building cubes on top of a relational database that is in 3rd normal form. It is strongly advisable to use a dimensional model with star schema for all cubes. For example you could have two fact tables: vehicles and options; each vehicle can come with a number of options. You're likely to examine vehicle sales by customer, and options by the items that are included in each option. Therefore you would have a customer dimension and item dimension. You could also want to examine vehicles sales by included item. If so the vehicle fact would be joined to the options fact and customer dimension; the options fact would also join to items' dimension.
Data mining target dimension is based on a mining model which is built from a source dimension. Both source dimension and target dimension must be included in the cube.