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

KB31592: A custom expression filter qualification using ApplyLogic is parsed as an "Invalid Expression" in the filter editor in MicroStrategy Developer 9.4.x and 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


A user tries to create a custom filter expression in MicroStrategy Desktop 8.1.x and 9.x using the ApplyLogic function, as illustrated below. The expression parser fails to validate the expression, with a message under the expression editor reading "Invalid Expression."

SYMPTOM
A user tries to create a custom filter expression in Strategy Desktop 8.1.x and 9.x using the ApplyLogic function, as illustrated below. The expression parser fails to validate the expression, with a message under the expression editor reading "Invalid Expression."
 

ka02R000000kcEhQAI_0EM440000002EJx.gif

 
Sql
ApplyLogic ( "#0 > #1 AND #2 > #3", Year@ID, 2003, Month@ID, 200301)
 
CAUSE
The usage of ApplyLogic is incorrect in this case.
 
ApplyLogic takes a list of arguments, where the first is a string providing the SQL syntax to pass through to the database and the remaining arguments are Boolean expressions. In the above example, the Boolean comparison operators are written into the string, and the function arguments are attribute forms and integer constants, which cannot be converted into true or false Boolean values.
 
The above expression should be rewritten as follows to validate successfully.
 

ka02R000000kcEhQAI_0EM440000002EKE.gif

 
Sql
ApplyLogic ( "#0 AND #1", Year@ID > 2003, Month@ID > 200301)
 
Another issue remains, however. After clicking OK to save the expression into the filter, the SQL string is replaced by a single comma. The resulting filter cannot be evaluated by Strategy SQL Generation Engine.
 

ka02R000000kcEhQAI_0EM440000002EKM.gif

 
ACTION
The issue of the incorrect expression saved into the filter definition has been logged for review by Strategy Engineering. Contact Strategy Technical Support for an update on the status of this issue.
 
WORKAROUND
The expression may be rewritten to use ApplyComparison instead.
 

ka02R000000kcEhQAI_0EM440000002EKK.gif

 
Sql
ApplyComparison( "#0 > #1 AND #2 > #3", Year@ID, 2003, Month@ID, 200301)
 
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

May 18, 2017

Last Updated:

May 18, 2017