Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

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

Kushal_Chawda

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
Author

Hi Kushal

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

Kushal_Chawda

Yes, you can

swuehl
MVP
MVP

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
Author

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

Kushal_Chawda

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