This is sample data and there are others columns and rows in dataset. Additionally, the dataset includes team names that differ from those in the sample provided. The "team_list" column indicates whether a user belongs to different teams(separated with comma), with the possibility of a user being associated with multiple teams simultaneously.
What I’m looking to do is create a dynamic way to fetch results based on the "team" column. Instead of hardcoding a specific team name, like "B2B," I’d love to allow users to select from this filter and suggested values for filter should come from team column, kind of like how we use the WHERE clause in SQL with the LIKE command (for example, `SELECT * FROM table WHERE team_list LIKE '%B2B%'`). Instead of hardcoding a specific value like "B2B," I’d love to have a user-friendly filter that lets users select from suggested values from the "team" column.
We're using this method to remove duplicates because users can belong to multiple teams, which can lead to repeated results. I would really appreciate it if someone could assist me in creating this filter! Thank you!
Hello Shivang01,
Firstly, it is possible to populate suggestions for a field's filters based on some other data, with suggest_explore and suggest_dimension (docs) parameters.
So, then, we just have to solve how to get all the distinct possible Team values into a single column (which you'll expose in it's own explore, specifically for the purpose of supporting suggest_explore and suggest_dimension)
How you can do this may vary by database dialect, which you did not mention. Some dialects like bigquery allow for unnesting which could be used to get the separate values (see example pictures). For others it may be more complex sql you need to write (e.g. one pass to get first entry, another pass to specifically get all the 2nd entries in the string column, etc.