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: 
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

Labels (1)
18 Replies
sunny_talwar
MVP
MVP

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
MVP
MVP

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
MVP
MVP

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)))