Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
suryaa30
Creator II
Creator II

error in expression ')' expected qlikview

The below expression in chart gives error. The syntax in expression editor does not throw any error.

Can someone suggest what needs to be tweaked in below expression

= IF($(eGrowthAvgPremium_CYvsPY)<1,'qmem://ImageName/RedArrow',IF(1<$(eGrowthAvgPremium_CYvsPY)<=$(eGrowthGoalSales_CYvsPY),'qmem://<bundled>/BuiltIn/minus.png',IF($(eGrowthAvgPremium_CYvsPY)>$(eGrowthGoalSales_CYvsPY),'qmem://ImageName/GreenArrow')))

err.PNG

Expressions when evaluated by parts work fine.

eGoalSalesCY=Sum({< GoalSales_Year = {'$(=Max(GoalSales_Year))'} >} Goals)

eGrowthGoalSales_CYvsPY=(($(eGoalSalesCY) / $(eGoalSalesPY))-1)

eGrowthAvgPremium_CYvsPY=($(eAvgPremiumCY)/$(eAvgPremiumPY)-1)

1 Solution

Accepted Solutions
sunny_talwar

May be this

If($(eGrowthAvgPremium_CYvsPY) < 1,'qmem://ImageName/RedArrow',

If(1 < $(eGrowthAvgPremium_CYvsPY) and $(eGrowthAvgPremium_CYvsPY) <= $(eGrowthGoalSales_CYvsPY), 'qmem://<bundled>/BuiltIn/minus.png',

If($(eGrowthAvgPremium_CYvsPY) > $(eGrowthGoalSales_CYvsPY), 'qmem://ImageName/GreenArrow')))

View solution in original post

9 Replies
vishsaggi
Champion III
Champion III

= IF($(eGrowthAvgPremium_CYvsPY)<1,'qmem://ImageName/RedArrow',

  IF(1 < $(eGrowthAvgPremium_CYvsPY)<=$(eGrowthGoalSales_CYvsPY),'qmem://<bundled>/BuiltIn/minus.png',IF($(eGrowthAvgPremium_CYvsPY)>$(eGrowthGoalSales_CYvsPY),'qmem://ImageName/GreenArrow')))


Can you rectify the one highlighted in the red.

sunny_talwar

May be this

If($(eGrowthAvgPremium_CYvsPY) < 1,'qmem://ImageName/RedArrow',

If(1 < $(eGrowthAvgPremium_CYvsPY) and $(eGrowthAvgPremium_CYvsPY) <= $(eGrowthGoalSales_CYvsPY), 'qmem://<bundled>/BuiltIn/minus.png',

If($(eGrowthAvgPremium_CYvsPY) > $(eGrowthGoalSales_CYvsPY), 'qmem://ImageName/GreenArrow')))

mostwanted123
Creator
Creator

Hi Surya,

Try this,

If($(eGrowthAvgPremium_CYvsPY)<1,'qmem://ImageName/RedArrow',if($(eGrowthAvgPremium_CYvsPY)<=$(eGrowthGoalSales_CYvsPY),'qmem://<bundled>/BuiltIn/minus.png',if($(eGrowthAvgPremium_CYvsPY)>$(eGrowthGoalSales_CYvsPY),'qmem://ImageName/GreenArrow')))

Regards,

Pratik

suryaa30
Creator II
Creator II
Author

Hi Vishwarath,

I am sorry I am not able to interpret what has to be changed??

vishsaggi
Champion III
Champion III

As suggested by Sunny in his reply, do like 1 < yourvariablename AND yourvariablename <= variablename.

suryaa30
Creator II
Creator II
Author

Hi All I understand <1 condition is causing the error but what is wrong in the syntax. can someone please elaborate?

hari8088
Creator
Creator

Not sure but look it once on marked one with blue

IF($(eGrowthAvgPremium_CYvsPY)<1,'qmem://ImageName/RedArrow',IF(1<$(eGrowthAvgPremium_CYvsPY)<=$(eGrowthGoalSales_CYvsPY),'qmem://<bundled>/BuiltIn/minus.png',IF($(eGrowthAvgPremium_CYvsPY)>$(eGrowthGoalSales_CYvsPY),'qmem://ImageName/GreenArrow')))



sunny_talwar

If condition in qlik cannot be like this

A < x < B... instead you need like this

A < x and x < B

suryaa30
Creator II
Creator II
Author

Thanks Much Sunny