Hello,
I'm trying to create a card with a filter "[column] is not empty", using the Metabase API (Metabase API documentation | Metabase Documentation) through a Python script. I have figured out how to create filters like "[column] is not [value]" (using !=
) but not "[column] is not empty". Obviously "[column] is not ''" does not work. How can I get to the intended result?
Thanks!
Hi there!
I recommend trying to create a question manually within Metabase and looking at what it sends to the API when saving it, in the Network Tab of your browser.
For instance, I created a card with a "not empty" filter and it sent something like this:
...
"dataset_query": {
"database": 1,
"type": "query",
"query": {
"source-table": 4,
"filter": [
"not-empty",
[
"field",
69,
{
"base-type": "type/Text"
}
]
]
}
},
...