Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

wanyunyang
Contributor

IF function

I'm writing a function like:

IF( = {'apple','pear','banana'},'Fruit','Others')

A is a field with values apple, pear, banana, candy, etc.

But the expression editor shows there is error in expression. The error message is: ')' expected.

Any ideas why? Thanks for help!

1 Solution

Accepted Solutions

Re: IF function

Only adding one parenthesys.

If(Match(A, 'apple', 'pear', 'banana'), 'Fruit', 'Others')

3 Replies
MVP
MVP

Re: IF function

Try with Match

If(Match(A, 'apple', 'pear', 'banana'), 'Fruit', 'Others')

Update: Added based on Rubin's response below

Re: IF function

Only adding one parenthesys.

If(Match(A, 'apple', 'pear', 'banana'), 'Fruit', 'Others')

MVP
MVP

Re: IF function

Yup