- Business Intelligence with MicroStrategy Cookbook
- Davide Moraschi
- 501字
- 2021-07-23 15:32:04
Parent-child relationship in a report
In the previous recipe, we created a very basic report with a list of countries. While we are in a development phase, this type of report is useful to control if the attribute forms have been created correctly. Similarly, to check the parent-child settings, you can create a quick report with two or more attributes involved in the relationships; just to be sure that every son has its father and no family is broken.
Getting ready
You need to have completed the previous recipes to continue.
How to do it...
We are now creating a report on the Time dimension:
- Go to My Personal Objects | My Reports, right-click on the right pane and select New | Report.
- Leave Blank Report selected and click on OK.
- In My Shortcuts pane on the left, click on Attributes, and from the list that appears on the right-click on Year.
- Select Add to Rows.
- Do the same with Month, you'll see that the two attributes appear as columns in the Report View pane.
- Run the report by selecting the View | Grid View menu.
- You can now click on Save and Close and name the report:
02 Calendar
.
How it works...
MicroStrategy reads the metadata to get the information needed to produce the SQL and issues the query. The resulting dataset is then displayed and the Parent
attribute rows are merged. You only see the Year
values appearing once in the grid, with the corresponding Months
, this is the default behavior.
There's more...
Re-run the report and look at the results, isn't it strange? Uh-Oh, year 2005 starts in July. In this particular case, we are using test data and in fact the database only holds dates starting from July 2005. However, in a real-world project, this situation should raise a flag of attention, and we'd better go to the sqlcmd
console to check the DimDate
table.
Now scroll to the end of the report. Year 2008 also has fewer months, year 2009 is missing, and year 2010 only has November. Definitely not a very good date dimension: can you imagine what would happen if we had sales in 2009 or 2010? Yes, probably they would disappear from the sales reports due to inner JOIN
and this is one of the most common mistakes we can do in BI. Sometimes dimension tables are incomplete, long forgotten, or simply not updated; it helps to check them every now and then.
It happened to a project of mine. Back in 2009, I had a Time
table with dates until year 2012: three years is a long life span for a report (I thought), so 2012 would be enough. Wrong! That report survived more than expected and in January 2013 it started returning no rows. With a red face I had to modify the Time
table and, since bad habits are hard to break, I inserted dates until 2015. Guess what?
- 自愿審計動機與質量研究:基于我國中期財務報告審計的經驗證據
- 新中國審計制度變遷
- 博弈論及其在經濟管理中的應用
- SAP ABAP Advanced Cookbook
- Microsoft Dynamics CRM 2011 Scripting Cookbook
- 基本有用的計量經濟學
- 審計基礎
- 企業并購審查中的相關市場界定:理論與案例
- Getting Started with Microsoft Lync Server 2013
- 下一場全球金融危機的到來:明斯基與金融不穩定
- Stata統計分析與行業應用案例詳解(第2版)
- 內審人員進階之道:內部審計操作實務與案例解析
- 效益實現管理實踐指南
- 汪博士解讀PMP?考試(第6版)
- 績效考核與薪酬激勵精細化設計必備全書