Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Wildcard column search

I want to pull rows in a column that contain the words "xyz" and put the results in a pie chart. The SQL equivalent would be [column name ] like %'xyz'%

7 Replies
MVP
MVP

Re: Wildcard column search

Would you be able to share some dummy raw data to understand better what you are looking for?

Re: Wildcard column search

Put the below expression pie chart

=sum({<Column ={'*xyz*'}>}Value)

or in script create the Flag

LOAD *,

if(lower(Column) like '*xyz*',1,0) as Flag

...

FROM Table

Now use the below expression in pie chart

=sum({<Flag={'1'}>Value)

Not applicable

Re: Wildcard column search

Hi Kushal

Do I use the column name as the dimension then use the =sum({<Column ={'*xyz*'}>}Value) as the measure?

Re: Wildcard column search

Yes, you can

MVP
MVP

Re: Wildcard column search

It's not exactely clear what results you want to show in your chart.

If you just want to filter your dimension values, you can use a set expression like shown above.

Or maybe you want to just get a count of the rows for column (assuming it's called YourFieldName) value containing xyz vs count of rows with other values, i.e. create a custom grouping of rows:

Create a calcuated dimension:

=If( YourFieldName LIKE '*xyz*', 'Containing xyz', 'Not containing xyz')

then as expression

=Count(YourFieldName)

[You can create a field in the script with above condition or replace the search term with a variable, just as you like.

In general, it's much easier to help you if you post some sample lines of input records and your expected result.]

Not applicable

Re: Wildcard column search

=sum({<column={"$(=wildmatch('column','%XYZ%'))"}>}Value)

Re: Wildcard column search

Expression which I have suggested will work.. don't require to use wildmatch function in set analysis