Reputation: 3760
I have a table like this:
Name | Array |
---|---|
Dog | [Barks, Furry] |
Cat | [Purrs, Furry, Other] |
Broken Duck | [Purrs, Feather] |
When I use a control and select Purrs and Furry, I get all three rows. The desired outcome is to only get the cat row.
Under the hood in BQ Name is a string and Array is actually an Array<struct<type: string, value:string>>
e.g. [{'array_element':'Barks'}]
with all type
values equal to array_element
.
Upvotes: 5
Views: 1164
Reputation: 6461
One approach is to use the CSV Filter Control Community Visualisation with the Array
field, excluding the [
and ]
characters:
REGEXP_REPLACE(Array, R"(\]|\[)", "")
Editable Google Data Studio Report (Embedded Google Sheets Data Source) and a GIF to elaborate:
Upvotes: 2