Skip to main content

Metric values are repeated across rows when a report is executed in MicroStrategy

Metric values are repeated across rows when a report is executed in MicroStrategy

When comparing report results between DB Query Tool and MicroStrategy, some reports show repeated metric values in MicroStrategy where there were none in DB Query Tool.

To illustrate the issue, a fact table CAT_ITEM_SLS has been added into the MicroStrategy Tutorial project and populated with a small set of three rows.

CAT_IDITEM_IDREVENUE
 110 
 120 
30 

Report results in DB Query Tool:

Report results in MicroStrategy:

In MicroStrategy, the row for "Art As Experience" in the Spring 2007 catalog repeats the $20 value from the Winter 2007 catalog, where DB Query Tool shows the $30 value from the fact table.

CAUSE
The discrepancy occurs because the attribute elements for Catalog and Item are in a many-to-many relationship, but the attribute relationship in the MicroStrategy schema is defined incorrectly with a one-to-many relationship.

Note: MicroStrategy Tutorial ships with a many-to-many relationship between Catalog and Item. The relationship was altered in the above example to illustrate the issue.

The MicroStrategy Analytical Engine prepares data for display in the cross-tabbing step by extracting, from the result table, several normalized tables for each attribute and metric. (This supports dimensionality-aware subtotals and dynamic aggregation, among other features.)

When attributes in a metric's dimensionality are related one-to-many according to the schema, the lowest-level child attribute is sufficient to identify each metric row uniquely. Users may observe this behavior in the MicroStrategy SQL Generation Engine, in that intermediate tables may omit one-to-many parent attributes. Thus, in the above example, MicroStrategy normalizes the Revenue metric results as follows:

ITEM_IDREVENUE
1$10
2$20

If the attribute elements truly had a one-to-many relationship, this normalized table would be valid because each Item ID would map onto exactly one Catalog ID. Item ID 2 maps onto two Catalog IDs, and its normalized metric value is repeated as a result.

ACTION
The report returns valid results if the attribute relationship is modified to be many-to-many. With a many-to-many relationship, the Analytical Engine normalizes the Revenue results based on both attributes and all three values are preserved in the normalized table.

In some scenarios, the warehouse data should have been in a one-to-many relationship but invalid data may have been introduced into the warehouse. Correcting the attribute ID values to maintain a true one-to-many data relationship will also resolve the issue.

Note: Changing the Analytical Engine VLDB property "Metric Level Determination" to the option "Include higher-level related attributes in metric level (deprecated)" bypasses the Analytical Engine normalization logic and also produces the expected report results. However, this could produce inflated subtotal or dynamic aggregation results for dimensional metrics. It is generally not recommended to change this setting except for temporary scenarios while fixing the incorrectly mapped data model.

IMPORTANT
According to KB6831 ("Known data modeling restrictions and solutions in MicroStrategy SQL Generation Engine"), MicroStrategy SQL Generation Engine does not support chains of many-to-many relationships. For example, the following hierarchy would not be valid, because of multiple counting and the removal of some filtering conditions. It may also cause join paths between attributes to be evaluated differently.

Not recommended:

Therefore, it is not a correct solution to change a large number of attribute relationships to be many-to-many.

An alternate approach to many-to-many relationships is to make the many-to-many attributes independent parents of a surrogate key attribute. The many-to-many attributes are not directly related to each other, but have separate one-to-many relationships to the surrogate key. The surrogate key can have as many parents as needed without violating the restriction against in-line many-to-many relationships. The surrogate key should be unique for every distinct combination of its parents. If the attributes exist in a denormalized dimension table, the table's primary key would suffice as the common child.


Comments

Post a Comment

Popular posts from this blog

Case functions Microstrategy

Ca se functions Microstrategy Case functions return specified data in a SQL query based on the evaluation of user-defined conditions. In general, a user specifies a list of conditions and corresponding return values. Case This function evaluates multiple expressions until a condition is determined to be true, then returns a corresponding value. If all conditions are false, a default value is returned.  Case  can be used for categorizing data based on multiple conditions. This is a single-value function. Syntax Case ( Condition1 ,  ReturnValue1 ,  Condition2 , ReturnValue2 ,...,  DefaultValue ) Example Case(([Total Revenue] < 300000), 0, ([Total Revenue] < 600000), 1, 2) sum(Case (Day@DESC in (ā€œSatā€,ā€Sunā€), Sales, 0) {~+} Sum(Case(Category@DESC In("Books","Electronics"),Revenue,0)){~+} CaseV (case vector) CaseV  evaluates a single metric and returns different values according to the results. It can be used to perfo...

MicroStrategy URL API Parameters

MicroStrategy URL Structure The following table summarizes the root URL structure used for every request to MicroStrategy Web. Environment Main Application URL Administration URL J2EE http://webserver/MicroStrategy/servlet/mstrWeb http://webserver/MicroStrategy/servlet/mstrWebAdmin .NET http://webserver/MicroStrategy/asp/Main.aspx http://webserver/MicroStrategy/asp/Admin.aspx Every request sent to MicroStrategy Web calls a central controller. Parameters are appended to  Main.aspx  or  mstrWeb  (in a .NET and J2EE environment, respectively) to indicate to the controller how the request should be internally forwarded and handled. The following examples show a URL for accessing a MicroStrategy folder when the user does not have an existing session. The URL contains not only the parameters needed to connect to MicroStrategy Web, but also the parameters needed to log on and create a session. J2EE environment: <a href="http:...

Microstrategy Dashboard performance improvements steps

Microstrategy  Dashboard performance improvements steps: Many times, causes of poor performance can be simplified to specific components. To troubleshoot performance issues, users must identify these components, then make the appropriate modifications to the environment and/or to the MicroStrategy dashboard to reduce bottlenecks. Dashboard execution stages can be represented below: MicroStrategy Intelligence Server When an end user makes a  Document Execution Request  through any client (a web browser via MicroStrategy Web, the MicroStrategy Desktop/Developer client, the MicroStrategy Mobile app, or the MicroStrategy Office client), the request is sent to the MicroStrategy Intelligence Server, which processes the request and prepares the response. The MicroStrategy Intelligence Server will execute all children datasets on the dashboard by either generating SQL and running this against the data warehouse, or by fetching data from a cache. The Inte...

User request is completed. (Ran out of memory)

Unable to Run/Edit particular MicroStrategy reports ue to the following error: User request is completed. (Ran out of memory) User request is completed. (Ran out of memory) The above issue appeared in MSTR Web Universal version 10.5 We tried the below options without any luck: 1. i-server restart 2. Web server restart 3. clear document cache/dataset cache 4. Web server cache clear as below: The correct option is to increase the contract memory settings: Using the Memory Contract Manager The  MCM settings are in the Intelligence Server Configuration Editor, in the  Governing Rules: Default: Memory Settings  category. The  Enable single memory allocation governing  option lets you specify how much memory can be reserved for a single Intelligence Server operation at a time. When this option is enabled, each memory request is compared to the  Maximum single allocation size (MBytes)  setting. If the request ...

Control the display of null and zero metric values

Show   Control the display of null and zero metric values in a grid report You can determine how to display or hide rows and columns in a grid report that consist only of null or zero metric values. You can have MicroStrategy hide the rows and columns in the following ways: Hide rows and columns that consist only of null metric values Hide rows and columns that consist only of zero metric values Hide rows and columns that consist only of null or zero metric values (default) Once you have defined how MicroStrategy hides null and zero metric values in the grid, you can quickly show or hide the grid using the Hide Nulls/Zeros option in the Data menu, as described below, or by clicking the  Hide Nulls/Zeros  icon  in the Data toolbar. To determine how null and zero metric values are displayed or hidden in a grid report Open the report in Edit mode. From the  Tools  menu, select  Report Options . The Report Options...

Create a transaction services photo uploader

Create a transaction services photo uploader   1.  Create a new table "photo_upload" in Tutorial warehouse database (the default location: C:\Program Files\MicroStrategy\Tutorial Reporting\TUTORIAL_DATA_7200.mdb), as shown below:    2. The 'photo_upload' table has to be pre-populated with *exactly* 10 rows of data, the values for the 'ID' column should be 1-10 and the values for the 'uploaded' column should all be 0 3.  In MicroStrategy Desktop, create a freeform report "R1" based on the new table "photo_upload" in Tutorial data created at step 1, as shown below:   SELECT Location, Description, ID, uploaded, numbers FROM PHOTO_UPLOAD 4.  Create another table for transaction insert SQL. Make sure to create an 'autonumber' type ID as primary key for this table, or auto_increment ID for different DBs.                     5. Create...

Retrieve a list of user groups and the associated users in MicroStrategy Developer 9.x / 10.x

Retrieve a list of user groups and the associated users in MicroStrategy Developer Follow the steps below to create a list of all groups and the users in each group: In MicroStrategy Developer 9.x, select 'Project Documentation' from the Tools menu to start the wizard. Select any project that is in the project source that contains the users and groups and click Next. Select only Configuration Objects for documentation. Uncheck the 'Basic Properties' object category from the next screen, as shown below: Then select only 'User Group' under the Configuration Objects section and only 'Groups' and 'Members' under the Definition section, as shown below: Go through the rest of the wizard, and open the resulting documentation. After navigating down to the User Groups, the documentation should look similar to the following image: This page shows every group, any child groups, and all members of each group.
Star schemas and aggregate (or summary) fact tables Aggregate tables can further improve query performance by reducing the number of rows over which higher-level metrics must be aggregated.  However, the use of aggregate tables with dimension tables is not a valid physical modeling strategy. Whenever aggregation is performed over fact data, it is a general requirement that tables joined to the fact table must be at the same attribute level or at a higher level. If the auxiliary table is at a lower level, fact rows will be replicated prior to aggregation and this will result in inflated metric values (also known as "multiple counting"). With the above Time dimension table, a fact table at the level of Day functions correctly because there is exactly one row in DIM_TIME for each day. To aggregate the facts to the level of Quarter, it is valid to join the fact table to the dimension table and group by the quarter ID from the dimension table. Sql select DT...

Search for Freeform SQL Reports in MicroStrategy Developer

Search for Freeform SQL Reports in MicroStrategy Developer Steps below will guide to find out all the Freeform SQL Reports in a project in MicroStrategy Developer: Log in to the particular project from Developer and click the search button or use Control +F Go to Tools > Options > Enable "Show ' Contains ' and ' Contained by ' tabs" as shown below: 3.  Click OK > Go to "Contains" tab and select Logical Table for "Contains any object of this type" as shown below:  4.  Then go to Object Types tab and select Report as the object as shown below: 5. Click Find Now and all Freeform SQL Reports will be displayed.

Multi-Table Data Import(MTDI) from one or more supported data sources

Multi-Table Data Import(MTDI) from one or more supported data sources In MicroStrategy Analytics Enterprise Web 10 onewards, users can now simultaneously import two or more tables from one or more supported data sources, this feature is called Multi-Table Data Import (MTDI) which has been renamed as Super Cubes in MSTR 2019 (Does it sound like multisourcing for all the users without admin help?) Currently, all connectors in MicroStrategy Web 10 except " OLAP " and " Search Engine Indices " support Multi-Table Data Import. Users are able to add multiple tables/files when doing data import from single connector, as shown below: Users are also able to combine multiple tables/files from different sources and store them into one single Intelligent Cube, as shown below: