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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using "like" function in SetExpression

It's possible to use like function in Set Expression?

What's the exact sintax for this?

Thanks a lot.

Nutis

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Like is a string operator, the Help says about like operator:


String comparison with wildcard characters. The operation returns a boolean true (-1) if the string before the operator is matched by the string after the operator. The second string may contain the wildcard characters * (any number of arbitrary characters) or ? (one arbitrary character).

Examples:

'abc' like 'a*' returns true (-1)
'abcd' like 'a?c*' returns true (-1)
'abc' like 'a??bc' returns false (0)

You can use the string operator e.g. in a field modifier search expression, e.g.

=sum({<Name= {"=Name like '*Stefan*'"}>} Value)

View solution in original post

2 Replies
swuehl
MVP
MVP

Like is a string operator, the Help says about like operator:


String comparison with wildcard characters. The operation returns a boolean true (-1) if the string before the operator is matched by the string after the operator. The second string may contain the wildcard characters * (any number of arbitrary characters) or ? (one arbitrary character).

Examples:

'abc' like 'a*' returns true (-1)
'abcd' like 'a?c*' returns true (-1)
'abc' like 'a??bc' returns false (0)

You can use the string operator e.g. in a field modifier search expression, e.g.

=sum({<Name= {"=Name like '*Stefan*'"}>} Value)

Not applicable
Author

If you want a equivalent expression of SUM(X) WHERE Y LIKE '*Pippo*', you can use SetAnalysis like this:

Sum( {<Y = {'*Pippo*'}>} X)

More info @ http://iqlik.wordpress.com/2010/09/11/the-magic-of-set-analysis-syntax-and-examples/