I encountered another issue with reference dimensions which I'm not sure if it's not by design. So I decided to ask
The problem is that I have the following:
- Fact table
- Dimension1
- Dimension2
Dimension1 is having a regular relationship to the fact table. When I deploy the project at this point, everything is working as expected - I can slice the measures by all the memebers of Dimension1's attribute hierarchies.
When I set Dimension2 as a reference materialized dimension to the fact table, using Dimension1 as a reference dimension, I encounter a big problem. As far as I understand how reference dimensions work, what happens behind the scenes is that the a FK to the referenced dimension (Dimension2) is also added to the fact table so that the slicing is possible. However, considering that I don't have a record in dimension2 for each record in dimension1, the result is that in the fact table I don't get all the possible slicings for dimension1 which I used to have before that. I guess that the SQL query it builds for populating the fact table is now an inner join with both tables (dimension1 and dimension2) which is perfectly valid if I'm slicing only through dimension2, but I still need the results which I got before that for dimension1 and the fact table.
I don't know if I made it clear, but the bottom line is that I need to be able to slice normally by all records in both dimensions - the usual and the referenced ones. Currently the setup (at least by default) stores records in the fact table only for the intersection of the two, which is undesired behavior in my case.
Any ideas if this is by design or if there's something wrong that I'm doing?
Cheers,
Alex
I forgot to mention that if I set the reference relationship not to be materialized, then everything works perfectly. But as from what I've read this is really not a good idea cause it's much slower.
So the question is - could I achieve the same behavior by preserving the materialization of the referenced relationship?
|||Any ideas?
No comments:
Post a Comment