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

KB236803: "Windowed functions and NEXT VALUE FOR functions do not support constants as ORDER BY clause expressions" error pops up when executing a report in MicroStrategy Analytics Developer 9.4.1


Stefan Zepeda

Salesforce Solutions Architect • Strategy


OLAP functions generate error messages.

SYPTOM:
On using the OLAP functions like RunningSum in the definition of metric , when executing the report it generates error as shown below:

ka02R000000kYU1QAM_0EM4400000029FU.jpeg


"Windowed functions and NEXT VALUE FOR functions do not support constants as ORDER BY clause expressions."

CAUSE:
The error message is caused by below SQL statement, in which "order by 1.0 asc" is impossible because 1.0 is a constant value.

ka02R000000kYU1QAM_0EM4400000029FN.jpeg


Select count (1.0) over (order by 1.0 asc rows unbounded preceding) WJXBFS1 from dbo.VW_VOL_EXCP a118

And the SQL is used for a RunningCount metric calculation. The metric has a definition as below:

ka02R000000kYU1QAM_0EM4400000029FV.jpeg
ka02R000000kYU1QAM_0EM4400000029FY.jpeg

The SQL is generated because there is no Sort By defined in the RunningCount metric, and by default, it uses the metric expression as Sort By value.
ACTION:
In RunningCount Parameters settings page, choose Sort By tab and use Sort by objects instead, as shown below.

ka02R000000kYU1QAM_0EM4400000029FW.jpeg

By doing this, the report can be run without error. And the SQL becomes reasonable as below:


Count (1.0) over(order by a118.FCLTY_NBR_TXT asc rows unbounded preceding)  WJXBFS1               

 
 


Comment

0 comments

Details

Knowledge Article

Published:

June 8, 2017

Last Updated:

June 8, 2017