Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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'%
Would you be able to share some dummy raw data to understand better what you are looking for?
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)
Hi Kushal
Do I use the column name as the dimension then use the =sum({<Column ={'*xyz*'}>}Value) as the measure?
Yes, you can
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.]
=sum({<column={"$(=wildmatch('column','%XYZ%'))"}>}Value)
Expression which I have suggested will work.. don't require to use wildmatch function in set analysis