Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
kkarlste
Creator
Creator

Expression

I don't understadt what is wrong this expression

 

 

if(right(MAX(MonthKEY), 2) = 01, avg({$<MonthKEY={"$(=Max(MonthKEY)-89)"}>}QC_EvaluationResult),
      avg({$<MonthKEY={"$(=Max(MonthKEY)-1)"}>}QC_EvaluationResult))

 

kkarlste_0-1696081080844.png

 

Labels (1)
5 Replies
Vegar
MVP
MVP

It could be your right(max()) that is causing trouble. Try this

right( MAXSTRING (MonthKEY), 2) = '01'

 

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The error message comes because on the second line you have unicode spaces (xE28082) instead of ascii spaces (x20) leading the line. Delete and retype those spaces in the editor to fix your issue. 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

kkarlste
Creator
Creator
Author

I don't understand  what I can do that?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Change it to:

if(right(MAX(MonthKEY), 2) = 01, avg({$<MonthKEY={"$(=Max(MonthKEY)-89)"}>}QC_EvaluationResult),
avg({$<MonthKEY={"$(=Max(MonthKEY)-1)"}>}QC_EvaluationResult))

kkarlste
Creator
Creator
Author

It' s good but label expression not valid

=if(right(MAX(MonthKEY), 2) = 01, MAX(MonthKEY)-89, MAX(MonthKEY)-1)