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

KB219359: Incorrect SQL generated in MicroStrategy Analytics Enterprise 9.4.1 Hotfix 6: Only the column alias names are shown without showing the full column expression


Community Admin

• Strategy


In MicroStrategy Analytics Enterprise 9.4.1 with Hotfix 6 installed, there are very specific situations where incorrect SQL will be generated for a report with 2 or more metrics. This can be observed in the SQL view where some rows will show only the column alias instead of the full column expression before the column alias.

SYMPTOM
In Strategy Analytics Enterprise 9.4.1 with Hotfix 6 installed, there are very specific situations where incorrect SQL will be generated for a report with 2 or more metrics. This can be observed in the SQL view where some rows will show only the column alias instead of the full column expression before the column alias. For example:
 
Incorrect SQL:


select a11.Attribute1 attr1,
         a12.Attribute2 attr2,
         WJXBFS1,
         WJXBFS2
from Table1 a11
cross join Table2 a12
...

  
Correct SQL:

select a11.Attribute1 attr1,
         a12.Attribute2 attr2,
         (Case when count(X)>1 then A else B end) WJXBFS1,
         (Case when count(Y)>1 then A else B end) WJXBFS2
from Table1 a11
cross join Table2 a12
...



STEPS TO REPRODUCE
The following steps are based on the Strategy Tutorial project and is one way of reproducing the issue.

  • Create a filter with definition 'Country (ID) > 0'
  • Create a second filter with definition 'Country (ID) > 0' AND 'Distribution Center (ID) > 0'
  • Create a metric M1 with definition 'Count([Distribution Center]){~}'. Add the filter from step 1 as a condition for this metric. The definition of the metric is as shown below:

ka04W000000OhECQA0_0EM440000002CC4.jpeg
ka04W000000OhECQA0_0EM440000002CC5.jpeg
  • Create a metric M2 with definition 'Count([Distribution Center]){~}'. Add the filter from step 2 as a condition for this metric.
  • Set the VLDB property for Metrics > Metric Join Type to Outer Join. This setting can be applied through report data options as well.
  • Set the VLDB property for Query Optimization > Sub Query Type to Option 5 'Use Temporary Table, falling back to EXISTS (SELECT ....)'
  • Create a report with attribute 'Country' and metrics M1 and M2
  • The SQL generated will be as below. Note that the metric within the subquery has no expression.

    select    pa13.COUNTRY_ID  COUNTRY_ID,	    a14.COUNTRY_NAME  CUST_COUNTRY_DESC0,	    pa13.WJXBFS1  WJXBFS1,	    pa13.WJXBFS2  WJXBFS2	from    (select    a12.COUNTRY_ID  COUNTRY_ID,	        count(a12.COUNTRY_ID)  WJXBFS1,	          WJXBFS2	    from    `CITY_CTR_SLS`    a11	        join    `LU_CALL_CTR`    a12

CAUSE
This is a known issue specific only to Hotfix 6 for Strategy Analytics Enterprise 9.4.1. Strategy Analytics Enterprise 9.4.1 GA or any previous Hotfix will not show this behavior.
This issue has been observed in reports with 2 or more conditional metrics which have been configured to work with an outer join. At the same time, VLDB property for SQL Global Optimization must be set to Level 3 or 4.
 
ACTION
This issue has been fixed in Strategy Analytics Enterprise Hotfix 7. Upgrade to this version to take advantage of the fix.
 
WORKAROUND
A possible workaround is to set the VLDB property for the SQL Global Optimization to Level 2.
The Strategy internal reference number for the issue discussed in this article is 978925.


Comment

0 comments

Details

Knowledge Article

Published:

May 30, 2017

Last Updated:

May 30, 2017