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

KB19557: ‘Generate SQL for attribute form expression failed, please check if the expression is valid’ error occurs when using an attribute in a report or prompt in MicroStrategy Developer 9.x and 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


KB19557: ‘Generate SQL for attribute form expression failed, please check if the expression is valid’ error occurs when using an attribute in a report or prompt in MicroStrategy Developer 9.x and 10.x

SYMPTOM
When a particular attribute is used in a report or prompt, the following error is produced in Strategy Developer 9.x and 10.x:
 

ka02R000000kXI1QAM_0EM440000002EjI.gif

 
Sample Code/Error
Error: SQLEngine got an Exception from DFC: Engine Logic: Generate SQL for attribute form expression failed, please check if the expression is valid.
Error in Process method of Component: SQLEngineServer, Error Code= -2147212800.
 
 
CAUSE
This issue can occur if an attribute form uses a Strategy function that does not have a SQL pattern for the warehouse database type.
 
Every function defined within Strategy has a list of SQL patterns for each database type that exists in the metadata. Many functions can be written in SQL. For instance, most databases use ABS(x) for absolute value; for these databases, the Abs() function in Strategy would have the SQL pattern ABS(#0). Some functions require different syntax on various database platforms, particularly OLAP functions such as Rank or MovingSum.
 
If a hypothetical database did not support a certain function, the function's SQL pattern for that database platform would be empty. If the function is used in a metric calculation, the Strategy Analytical Engine takes over the calculation. However, attribute form expressions may be used for grouping aggregate calculations. Thus they must be written into SQL, and functions that will have to be evaluated in the Analytical Engine for that database platform cannot be supported.
 
ACTION
To resolve the issue, identify the attribute form(s) using Strategy functions. Iterative testing is a valuable diagnostic: remove attributes from the report one by one until the error no longer appears. The last attribute to be removed is probably the cause of the error.
 
Strategy functions that do not have a built-in SQL pattern for the database platform can be replaced by ApplySimple expressions, provided that some syntax exists for the database.
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 19, 2017

Last Updated:

June 19, 2017