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

KB44875: Threshold defined on attribute DESC form is not getting applied if using ApplySimple in attribute form expression in MicroStrategy 9.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


SYMPTOM:
 
An attribute DESC form is defined with ApplySimple expression. However, if the users define threshold based on the description form of this attribute, the threshold is not applied.
 
STEPS TO REPRODUCE:
 
 
 
 
- Source table of ID form: LU_REGION;
- ID form expression: LU_REGION.
- Source table Desc form: LU_REGION;
- Desc form expression: ApplySimple("CASE  WHEN #0=1 THEN #1 ELSE ' ' END", , )
 

ka02R000000kYXUQA2_0EM440000002Cdw.jpeg

Note: This expression means that when COUNTRY_ID is not 1, the Desc form for Region_Test will be ' '. 
 
 
 
Region_Test Where DESC is Null. Font color in red.
 

ka02R000000kYXUQA2_0EM440000002Cdu.jpeg

 

  1. Use Project Mover to migrate Tutorial metadata and warehouse from MS Access to SQL Server 2008.
  2. Connect to the SQL Server 2008 version Tutorial project in Desktop.
  3. Create a new attribute "Region_Test" and define as follows: 
  4. Create report with Region_Test, Country and Revenue.
  5. Define a threshold for metric Profit with condition as follows
  6. Run report. Notice that the threshold is not applied to records where element of Region_Test whose value is null.

 
 
CAUSE:
 
In following form expression, notice that there is space between the quotation after ELSE statement. The engine will treat it as a space instead of NULL value.
 
ApplySimple("CASE WHEN #0=1 THEN #1 ELSE ' '  END", , ). 
 
ACTION:
 
Two workarounds can be taken to resolve this issue.
 

ka02R000000kYXUQA2_0EM440000002Cdq.jpeg

 
 
 
ApplySimple("CASE WHEN #0=1 THEN #1 ELSE NULL  END", , ). 
 
 

  • Keep the form expression unchanged. In threshold, use the condition as "Region_Test where DESC Exactly EMPTY", then threshold will be applied to those elements whose DESC is a space.
  • Change the DESC form expression to the following. This will make the DESC a NULL value if COUNTRY_ID does not equals to 1.

 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 7, 2017

Last Updated:

June 7, 2017