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

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

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
Champion III
Champion III

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/