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

How to solve "Error in expression: ')' expected"?

I have the following statement that works in my load script:

if(match([Reason For Error], 'In Inventory but Company Code not eligible for GL', 'In inventory but invalid Cost Center/Company Code'), 'Yes', 'No') as [Invalid Coding]

I am trying to do the following instead:

SET invCod1='In Inventory but Company Code not eligible for GL';

SET invCod2='In inventory but invalid Cost Center/Company Code';

if(match([Reason For Error], $(invCod1), $(invCod2)), 'Yes', 'No') as [Invalid Coding]

However when I do this I get the error "Error in expression: ')' expected". I think this has to do with the parentheses interfering with each other. Is there a way to fix this?

1 Solution

Accepted Solutions
rubenmarin

Hi noah,

Can you try?:

if(match([Reason For Error], '$(invCod1)', '$(invCod2)'), 'Yes', 'No') as [Invalid Coding]

View solution in original post

2 Replies
rubenmarin

Hi noah,

Can you try?:

if(match([Reason For Error], '$(invCod1)', '$(invCod2)'), 'Yes', 'No') as [Invalid Coding]

Not applicable
Author

That works! Thanks!