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

KB19309: Why does the SQL Engine generate [An analytical SQL] statements and what is their meaning in MicroStrategy Engine?


Community Admin

• Strategy


This article explains what analytical SQL statements are in MicroStrategy report SQL

SYMPTOM:
 
The SQL Generation Engine is generating the statements below in the SQL of a report in Strategy:
[Analytical SQL calculated by the Analytical Engine: ]
insert into ZZMD00 values ([DummyInsertValue])
 
STEPS TO REPRODUCE:
 
Follow the steps below to obtain the statements above in the Strategy Tutorial Project:
 

  1. Create a report with attribute Subcategory and metrics Sales Rank and Revenue.
  2. View the report in SQL View:

select a11.[SUBCAT_ID] AS SUBCAT_ID,
sum(a11.[TOT_DOLLAR_SALES]) AS WJXBFS1
from [STATE_SUBCATEG_REGION_SLS] a11
group by a11.[SUBCAT_ID]
 
create table ZZMD00 (
 
SUBCAT_ID SHORT,
WJXBFS1 DOUBLE)
 
[Analytical SQL calculated by the Analytical Engine: ]
 
insert into ZZMD00 values ([DummyInsertValue])
 
create table ZZMD01 (
 
SUBCAT_ID SHORT,
Revenue DOUBLE)
 
insert into ZZMD01
 
select a11.[SUBCAT_ID] AS SUBCAT_ID,
sum(a11.[TOT_DOLLAR_SALES]) AS Revenue
from [CITY_SUBCATEG_SLS] a11
group by a11.[SUBCAT_ID]
 
select pa11.[SUBCAT_ID] AS SUBCAT_ID,
 
a13.[SUBCAT_DESC] AS SUBCAT_DESC,
pa12.[WJXBFS1] AS WJXBFS1,
pa11.[Revenue] AS Revenue
from [ZZMD01] pa11,
[ZZMD00] pa12,
[LU_SUBCATEG] a13
where pa11.[SUBCAT_ID] = pa12.[SUBCAT_ID] and
pa11.[SUBCAT_ID] = a13.[SUBCAT_ID]
drop table ZZMD00
drop table ZZMD01
 
CAUSE:
 
This is working as designed. The Analytical Engine is performing some calculation or manipulation of the data that is returned in the first pass of the report SQL to use in subsequent passes.
 
The Analytical SQL can be divided in to parts:
 

  1. [Analytical SQL calculated by the Analytical Engine: ]
    There is no way to see this Analytical Engine SQL. In fact, the code produced by the Analytical Engine may not even be SQL, it could be an internal function written in some programming language. The reason for this is that the Analytical Engine is responsible for performing formatting and calculations that cannot be done by the database. If the database supported the requested calculation, then it would be translated into sql and run against the warehouse.
     
  2. [insert into ZZMD00 values ([DummyInsertValue])]
     
    These inserts can be viewed by enabling SQL Trace. Refer to following the Strategy Knowledge Base article for more information on Engine Diagnostics:
     

KB5273: Diagnostic logs to enable when troubleshooting Strategy Engine 
 


Comment

0 comments

Details

Knowledge Article

Published:

May 17, 2017

Last Updated:

May 17, 2017