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

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register 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.