Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ms206147
Contributor II
Contributor II

Expression Error

When attempting to use the following QlikView expression in QlikSense, I get an error:

expression:
='Viewing '&%DateType&' '&%Period&' for '&
IF(%Period='Month to Date',ONLY({<MonthID= {$(=Max({$}MonthID))}>}$(=%Year)&'-'&$(=%MonthDisplay)),
IF(%Period='Quarter to Date',ONLY({<MonthID= {$(=Max({$}MonthID))}>}$(=%Year)&'-'&$(=%Quarter)),
IF(%Period='Year to Date',ONLY({<MonthID= {$(=Max({$}MonthID))}>}$(=%Year)))))

Error:
see screenshot attachment



Labels (1)
3 Replies
lennart_mo
Creator II
Creator II

Hi @ms206147,

the error seems to lie in the expression $(=%Year). If you look at the evaluated formula you'll see a dash instead of - what i'm guessing - should be a field name. 

Qlikview_expression_error.jpg

 

WeLoveQlik
Partner - Creator
Partner - Creator

Try replacing Only() with Max() or MaxString() if those values are loaded as text

IPC Global: ipc-global.com
ms206147
Contributor II
Contributor II
Author

Thanks all.

The solution was to remove the $ and the = for the year and month.