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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
lucasx15
Contributor III
Contributor III

IF with Error: Garbage after expression

Hello everyone. I'm new to qlikview. I recently needed to add an aggregation expression to a text object. I added it inside a variable in which I called vOcup, this variable has an 8 which is the code of a client that I defined in my filter. however, it returned the error of IF with Error: Garbage after expression: ','. I couldn't understand where the error is. Because in my script no error was flagged.

 

This my expression:

 

 

=    
   IF(num(AVG( INTERN.OCUP),'#0,0') >       avg( TOTAL.OCUP), 
   num(AVG( INTERN.OCUP),'#0,0') & '/' & avg(TOTAL.OCUP),
   num(AVG(  INTERN.OCUP),'#0,0') & '/' & avg( TOTAL.OCUP))

 

 

This my  object text  that returns Error: Garbage after expression: ','.:

 

 

=$(vOcup("8"))

 

 

 

Labels (1)
1 Reply
vinieme12
Champion III
Champion III

Are you Trying to create a parameterized variable ? 

If not, then just this is needed

 

=$(vOcup)

 

refer this if you are trying to create a parameterized variable

https://analyticshub.io/2020/04/28/creating-parameterized-variable-in-qlik-sense-and-qlikview/

 

 

=  IF( AVG(INTERN.OCUP) > avg( TOTAL.OCUP), 
   num(AVG(INTERN.OCUP),'#0,0') & '/' & avg(TOTAL.OCUP),
   num(AVG(INTERN.OCUP),'#0,0') & '/' & avg( TOTAL.OCUP))

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.