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

KB11294: “Analytical Engine Error. Variant conversion failed,” or “Method ‘~’ of object ‘~’ failed” error message appears when using a Date attribute defined with an ApplySimple function in the Page-by of a MicroStrategy 10.x report.


Community Admin

• Strategy


This article describes how to avoid the error message when using a date attribute defined with an ApplySimple function in the Page-by of a MicroStrategy 10.x report

SYMPTOM:
Error messages appear when using a Date attribute defined with an ApplySimple function in the Page-by of a Strategy 10.x report. To reproduce this issue, perform the following steps:
 

  • Define an attribute with the following form expression:
ka04W000000Ody9QAC_0EM440000002Flz.jpeg
  •  
    ApplySimple("convert(char, #0, 1)", DAY_DATE)
  • Create a new report with the above ApplySimple attribute in the Page-by, another attribute in the rows, and a metric in the columns:
ka04W000000Ody9QAC_0EM440000002FmK.jpeg
  • Execute the report and notice that for the first date, everything is returned correctly. However, if another element is selected from the Page-by, the following error message appears:
ka04W000000Ody9QAC_0EM440000002FmA.jpeg
  •  
    
    Analytical Engine Error. Variant conversion failed.

     
  • If the report is saved and closed, reopen the report and click on the Grid View button. Another error message now appears:
ka04W000000Ody9QAC_0EM440000002Fm0.jpeg


Method '~' of object '~' failed.

 

Clicking the Re-execute button will result in another "Variant conversion failed" error message:

ka04W000000Ody9QAC_0EM440000002Fm9.jpeg

 


Analytical Engine Error. Variant conversion failed.

 

CAUSE:
When the ApplySimple Date attribute is defined, the Strategy Engine automatically defines the Form Format of the attribute as "Datetime" because the raw data is being pulled from a Data column. However, the ApplySimple statement is running a database-specific function(s), and with this example, changing the data type from Datetime to Char. This causes the Engine to incorrectly try to convert the Char being returned by the database into a Datetime format.
 
ACTION:
When the ApplySimple attribute is defined, change the form format type from Datetime to the appropriate value depending on the applysimple function if the function is returning data that is formatted differently than how it is stored in the warehouse.
The Editor automatically selects Datetime because the only thing that it is aware of is that it is using a Datetime column, and passing it through another Warehouse-side function. It does not know what the function is. Therefore, the developer must be aware that Strategy Developer will not automatically know if the values are going to be converted on the return to a different data type than how it is stored in the warehouse.
Thus, to obtain the desired results, go back into the attribute and change the form format to Text:
 

ka04W000000Ody9QAC_0EM440000002FmJ.jpeg

 
Notice now that by selecting any Date, the data will be returned correctly:

ka04W000000Ody9QAC_0EM440000002Fm8.jpeg

 


Comment

0 comments

Details

Knowledge Article

Published:

June 14, 2017

Last Updated:

June 14, 2017