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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Expression error

Hi,

I need to find the error in expression like i am getting red underline at the flower braces,can any one find out why it is happen and please guide me.

2.png

18 Replies
sunny_talwar

Can you post this expression as text instead of image? Also, you can try using If statement within Count instead of Set Analysis or create a field in the script for the left hand side of the set analysis equation.

agni_gold
Specialist III
Specialist III

Please copy paste your script

nareshthavidishetty
Creator III
Creator III
Author

if (CenterName='ThirdParty',0,1-((count({<vDate={">=$(=(MonthStart(vYesterday)))<=$(=vYesterday)"}>} if((Satisfied<4.5),ServiceOrderNo))

)/(count({<vda={">=$(=(MonthStart(vYesterday)))<=$(=vYesterday)"}>) ServiceOrderNo)))

nareshthavidishetty
Creator III
Creator III
Author

if (CenterName='ThirdParty',0,1-((count({<vDate={">=$(=(MonthStart(vYesterday)))<=$(=vYesterday)"}>} if((Satisfied<4.5),ServiceOrderNo))

)/(count({<vda={">=$(=(MonthStart(vYesterday)))<=$(=vYesterday)"}>) ServiceOrderNo)))

nareshthavidishetty
Creator III
Creator III
Author

am getting the error at vDate={ at this brace

sunny_talwar

vDate is a variable or a field created in script?

agni_gold
Specialist III
Specialist III

Sunny is right , please explain some more about your expression

Sunny T

nareshthavidishetty
Creator III
Creator III
Author

It's a variable like vDate=date#(%key,'0123456789','MM/DD/YYYY) WHERE %KEY IS A COMPOSITE KEY

sunny_talwar

I think you should create a field called date in your Script:

LOAD %key,

          Date(Date#(KeepChar(%key,'0123456789/'),'MM/DD/YYYY)) as DateField

From Source


Then give a shot at your expression with the following changes:


If(CenterName='ThirdParty', 0, 1-((Count({<DateField={">=$(=Date(MonthStart(vYesterday)))<=$(=Date(vYesterday))"}>} if((Satisfied<4.5),ServiceOrderNo))

)/(count({<DateField={">=$(=Date(MonthStart(vYesterday)))<=$(=Date(vYesterday))"}>) ServiceOrderNo)))