Ratios - Tržba/m2

General recommendations for saving ratios in the data warehouse is to store separately the numerator and denominator separately. In the case where the metric is calculated as the ratio of facts and metrics dimensional attribute this recommendation is met implicitly. The question is how to design metadata in OBI. Eg.: Data Model: F_SALES_BY_STORE_PD. SALES_AMT (sales) and D_STORE.STO_SELLING_AREA (m2 sales area stores). We are interested in "sales per m2 of sales area stores" (hereinafter Tržba/m2). BMM layer OBI looks like this: A classic model where:







  • Fact-Sales has LTS: F_SALES_BY_STORE_PD and
  • STO_SELLING_AREA is an attribute dimension Dim - Store that has LTS D_STORE
is unsatisfactory. Set returns incorrect result when the totalized sales, sales area is divided by only one of the stores. It is nowhere said that the need STO_SELLING_AREA across multiple stores together. Sales / Sales area (m2) = "- basic metrics." "sales" / shop. "Sales area (m2)" The solution could be pulling STO_SELLING_AREA dimension of the Fact Sales-whether by creating a view on the db level, or at the BMM layer (new table for the current LTS). Now you can set the aggregation rule of SUM STO_SELLING_AREA. Is not won.They are not treated in situations where it makes sense to add STO_SELLING_AREA and when not (need is the sum of sales areas such stores, each store contributes its sales area to the total sum in the period examined just once) real solution involves adding an attribute to the Fact-STO_SELLING_AREA Sales. However, it is necessary to have STO_SELLING_AREA mapped to the new LTS consists of a table setting with D_STORE = Content Store detail. Now at the newly created logical metadata defined metrics used in the report generates the correct SQL query, consisting of two subdotazů:And we're in goal, even if ... it would not improve in terms of business logic. Demonstration of the method of implementation of calculation is unfair to stores that are open fewer days than others, or for stores that started their activities sometimes during the reporting period.