Fatemeh Rostami
Fatemeh Rostami

Reputation: 1095

Metabase - create filter from json field

Is there a way to add a filter based on extracted data from a json field? currently I can do something like

json_extract(meta, '$.mp_origin_meta') AS booking_type)

or

meta->'$.mp_origin_meta'

to extract specific data by writing a native query, but I really want to add this like a filter to my dashboard.

Upvotes: 0

Views: 723

Answers (2)

Yasif Choudhary
Yasif Choudhary

Reputation: 1

select * from table where column."field" = 'string-field-value';

select * from table where column."field" = numeric-value;

Upvotes: 0

Fatemeh Rostami
Fatemeh Rostami

Reputation: 1095

I solve this problem using our analytics script which sends our data to Metabase. Generally, we have to create a virtual field in our table and add the json extracted value to that new field. I did this programmatically with a PHP script, but there must be a way to add a field via Metabase panel.

Upvotes: 0

Related Questions