EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB13015: Datamart references itself when trying to update with information in MicroStrategy Developer 9.x and 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


Datamart references itself when trying to update with information in MicroStrategy Developer 9.x and 10.x

SYMPTOM:
A datamart references itself when trying to update with information in Strategy Desktop 9.x. Specficially this involves choosing the old version of the datamart table as the source table when rerunning the report to create the datamart.
 
STEPS TO REPRODUCE:
Follow the steps below to reproduce this issue using the Strategy Tutorial project:
 

  • Create a datamart table with Year In list {2004} in the filter, as shown below:
ka02R000000kVqlQAE_0EM440000002FYS.jpeg
  • Execute the datamart and add the datamart table to the project. The following is the SQL that runs when the datamart is executed for the 1st time:

    Sample Code/Error

    select a12.YEAR_ID YEAR_ID,
    a11.QUARTER_ID QUARTER_ID,
    max(a12.QUARTER_DESC) QUARTER_DESC,
    sum(a11.TOT_DOLLAR_SALES) Sales_Metric
    into Datmart_Table
    from QTR_CATEGORY_SLS a11
    join LU_QUARTER a12
    on (a11.QUARTER_ID = a12.QUARTER_ID)
    where a12.YEAR_ID in (2004)
    group by a12.YEAR_ID,
    a11.QUARTER_ID


     
  • Once the datamart table is added to the project, execute the datamart again and notice that the datamart calls on itself, as shown in the SQL below:

    Sample Code/Error

    select a11.YEAR_ID YEAR_ID,
    a11.QUARTER_ID QUARTER_ID,
    a11.QUARTER_DESC QUARTER_DESC,
    a11.Sales_Metric Sales_Metric
    into Datamart_Table
    from Datamart_Table
    where a11.YEAR_ID in (2004)


     

CAUSE:
When bringing in the datamart table, it has a lower Logical Table Size than the fact table. Thus, the datamart table seems the optimal table to select from. However, when running the datamart report to refresh the data, this will not make any sense to call upon itself.
 
ACTION:
This is functioning as designed. To avoid this behavior, after creating the datamart and adding the table to the warehouse catalog, create a fact whose only source table is the datamart table and modify the existing fact to remove the datamart table from its source tables.
 
Detailed steps are given below:

  1. Review the datamart report and find the fact associated with the metric (the metric that is being calculated from the datamart table). Assume that the fact name is 'Revenue_Fact'
  2. Edit the fact 'Revenue_Fact' and remove the table 'Datamart_Table' as a source table for this fact.
  3. Create a new fact called 'Revenue_Agg_Fact' using only the 'Revenue' column in the datamart table 'Datamart_Table'. Metrics based on this fact can be used in reports where users wish to see aggregated data.
  4. Update the schema.

Useful Reference:
KB16268: How to run a report directly against a Datamart table in Strategy 9.x?
 
NOTE: It is not recommended, but the user can change the Logical Table Size to a larger size to ensure that the datamart does not read from itself.
 


Comment

0 comments

Details

Knowledge Article

Published:

May 22, 2017

Last Updated:

May 22, 2017