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

KB16484: 'An aggregate cannot appear in an ON clause unless it is in a subquery contained in a HAVING clause or select list, and the column being aggregated is an outer reference' error occurs when running a report in MicroStrategy Desktop or Web 10.x


Community Admin

• Strategy


'An aggregate cannot appear in an ON clause unless it is in a subquery contained in a HAVING clause or select list, and the column being aggregated is an outer reference' error occurs when running a report in MicroStrategy Desktop or Web 10.x

SYMPTOM:
When running a report in Strategy Desktop or Web 10.x, the following error occurs:
 

ka04W000000OfcVQAS_0EM440000002BS4.jpeg

 
QueryEngine encountered error: Execute Query failed. Error type: Odbc error. Odbc operation attempted: SQLExecDirect. An aggregate cannot appear in an ON clause unless it is in a subquery contained in a HAVING clause or select list, and the column being aggregated is an outer reference.
CAUSE:
This error is due to the SQL engine attempting to add an aggregation statement within the join portion of the SQL generated, and depending on the report, on the WHERE clause too, as shown below:
 

ka04W000000OfcVQAS_0EM440000002BS0.jpeg

 
For instance, a specific attribute might have been defined with an ApplySimple statement having an aggregation defined, as shown below:
 

ka04W000000OfcVQAS_0EM440000002BRy.jpeg

 
ACTION:
If this attribute must be included in the report, redefine the attribute form without the aggregation, as shown below:
 

ka04W000000OfcVQAS_0EM440000002BRx.jpeg

 
16484


Comment

0 comments

Details

Knowledge Article

Published:

June 10, 2017

Last Updated:

May 29, 2018