Created
November 16, 2025 09:28
-
-
Save repodevs/1c70246dc395a029b6b760b03235c79f to your computer and use it in GitHub Desktop.
Metabase filter string as array using delimiter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| id, name | |
| FROM table_users | |
| WHERE 1=1 | |
| [[ AND name = ANY(STRING_TO_ARRAY({{ user_name }}, ',')) ]] | |
| -- `user_name` is metabase variables, type: Text | |
| -- `','` is the delimeter | |
| -- usage: in variablse `user_name` -> `Sky,Blue,Green` | |
| -- it's will equal to `AND name IN ('Sky', 'Blue', 'Greem') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment