hi, I have a modeling question. I created a star: ...
# gooddata-platform
h
hi, I have a modeling question. I created a star: • the central node a fact table Expense • connected attribute tables: category, controller etc • connected fact tables: report Some numbers that are stored per report. I would like to display these report fact items in an Bar chart Insight, then add the Controller Name for context. I noticed that it works when adding the Metrics first and then add the controller name to the View By. If I try the other way around (Controller Name first to View By) it doesn't work, because the report table facts get hidden. Can you please explain this behaviour ?
j
Basically, slicing works only from right to left, or against the direction of arrows. We generally build reports and metrics that move from right to left along your data model-- ideally slicing aggregations of facts on the right by attributes to the left. Generally speaking, the star shape or snowflake shape are not ideal as they can create infinite loops in your reporting. There is a nice article here, and there is even a free course you can help assist with this on our GoodData University GoodData Cloud Native
h
Thanks Joseph. Now I understand why the model by default is aligned in such a way 🙂 I will read up on this article you shared.
👍 1
Does this mean I cannot aggregate any facts from the left of my central table Expense? Edit: it seems it can be done, when I see the example model in Basic rules. I have a similar setup with Orderline, order and product.
j
It is possible to do, but can affect other reports you try and build later on, or work with other datasets which cannot be connected via “BY Clause.”
h
I see now that only when I add the PK Report ID of the table after I have added the facts, the other dimension Controller becomes available. Is that an effect of that View BY?
j
The aggregated facts should be in N:1 relation with dimensionality of the insight (combination of attributes) to prevent double counting. The tool tries to protect you from reporting data on level of report for each expense. BY keword in MAQL can be used to use aggregation by Report in insight sliced by Expense. The same value will be repeated multiple times for each expense from the same report
h
Thanks, I think I understand. I will check out the numbers to verify.