Put the below expression pie chart
or in script create the Flag
if(lower(Column) like '*xyz*',1,0) as Flag
Now use the below expression in pie chart
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
[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.]