Error using Field Filters in a dashbord

Hello!

I am wrinting because I just created a question using SQL and I added Field Filters in SQL too so everything Ok . Also I can add my query in a Dahboard already created and merge with widget filters but when i save all of these and I try to use the filter in my Dashboard, is appearing an error to “show th graphic” . Attached a screenshot of that error.

How could I solve it? Thank you very much!

Hi @singular
Post “Diagnostic Info” from Admin > Troubleshooting.
Check the error log for more details - Admin > Troubleshooting > Logs.
And see this article on how to use Field Filters:
https://www.metabase.com/blog/field-filters/index.html

Hello @flamber

{
“browser-info”: {
“language”: “es-ES”,
“platform”:
“userAgent”:
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.5+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.5”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.5+10”,
“os.name”: “Linux”,
“os.version”: “4.15.0-1057-aws”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“postgres”,
“mysql”,
“h2”,
“googleanalytics”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “12.1 (Ubuntu 12.1-1.pgdg18.04+1)”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-04-21”,
“tag”: “v0.35.3”,
“branch”: “release-0.35.x”,
“hash”: “1d424cb”
},
“settings”: {
“report-timezone”: “Europe/London”
}
}
}

Hello again! It was necessary information??

I continue with the same error. Do you know another thing that I can do? @flamber

Thank you, regards.

@singular
Check the error log for more details, when you see the error on the dashboard - Admin > Troubleshooting > Logs
Latest release is 0.36.4

Hello @flamber

We are studying and trying to understand the error but after many chances of modifications, we don’t have sucess.

We have version 0.35.3. If we have to update, the information: colections, dashboards etc. will be lost?

Thank you,

Here is the error information, maybe you could help us with that:

[70df4076-6145-4b57-99b9-217ddf12a42c] 2020-08-19T14:33:31+01:00 ERROR metabase.query-processor.middleware.catch-exceptions Error processing query: null
{:database_id 2,
:started_at (t/zoned-date-time “2020-08-19T13:33:30.757786Z[GMT]”),
:state “42P01”,
:json_query
{:constraints {:max-results 10000, :max-results-bare-rows 2000},
:type :native,
:middleware nil,
:native
{:template-tags
{“created_at” {:id “7bc83859-2698-948b-a99c-44176ef1dd49”, :name “created_at”, :display-name “Created at”, :type :dimension, :required false, :dimension [:field-id 276], :widget-type :date/range},
“category_name” {:id “9c05cd27-34c8-9113-ba3b-34f176b87070”, :name “category_name”, :display-name “Category name”, :type :text},
“state_name” {:id “db050492-88fc-3937-b5f0-4fcea82798f4”, :name “state_name”, :display-name “State name”, :type :dimension, :dimension [:field-id 303]}},
:query
“select *\nfrom app.tickets as t\nleft join app.category as c on c.id = t.category_id \nleft join app.locations as l on l.id = t.location_id\nleft join app.users as u on u.id = t.created_by\nleft join app.tikect_states as ts on ts.id = t.last_state_id\nwhere t.vendor_id = 77 \nand t.type_id in (3,2,1) \nand t.created_at >= ‘01/01/2020’\nand t.is_archived is false\nand (category_id is null or c.name != ‘Obra 4000’)\n[[and t.created_at = {{created_at}}]]\n[[and c.name = {{category_name}}]]\n[[and ts.name = {{state_name}}]]\norder by t.id desc”},
:database 2,
:parameters [{:type “category”, :target [“dimension” [“template-tag” “state_name”]], :value [“in process”]}],
:async? true,
:cache-ttl nil},
:status :failed,
:class org.postgresql.util.PSQLException,
:stacktrace
[“org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)”
“org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)”
“org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)”
“org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)”
“org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)”
“org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:149)”
“org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:108)”
“com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:431)”
“–> driver.sql_jdbc.execute$fn__70660.invokeStatic(execute.clj:267)”
“driver.sql_jdbc.execute$fn__70660.invoke(execute.clj:265)”
“driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:389)”
“driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:377)”
“driver.sql_jdbc$fn__72711.invokeStatic(sql_jdbc.clj:50)”
“driver.sql_jdbc$fn__72711.invoke(sql_jdbc.clj:48)”
“query_processor.context$executef.invokeStatic(context.clj:59)”
“query_processor.context$executef.invoke(context.clj:48)”
“query_processor.context.default$default_runf.invokeStatic(default.clj:69)”
“query_processor.context.default$default_runf.invoke(default.clj:67)”
“query_processor.context$runf.invokeStatic(context.clj:45)”
“query_processor.context$runf.invoke(context.clj:39)”
“query_processor.reducible$pivot.invokeStatic(reducible.clj:34)”
“query_processor.reducible$pivot.invoke(reducible.clj:31)”
“query_processor.middleware.mbql_to_native$mbql__GT_native$fn__43003.invoke(mbql_to_native.clj:26)”
“query_processor.middleware.check_features$check_features$fn__42317.invoke(check_features.clj:42)”
“query_processor.middleware.optimize_datetime_filters$optimize_datetime_filters$fn__43168.invoke(optimize_datetime_filters.clj:133)”
“query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__47065.invoke(wrap_value_literals.clj:137)”
“query_processor.middleware.annotate$add_column_info$fn__40946.invoke(annotate.clj:577)”
“query_processor.middleware.permissions$check_query_permissions$fn__42192.invoke(permissions.clj:64)”
“query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__43667.invoke(pre_alias_aggregations.clj:40)”
“query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__42390.invoke(cumulative_aggregations.clj:61)”
“query_processor.middleware.resolve_joins$resolve_joins$fn__44199.invoke(resolve_joins.clj:183)”
“query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__39133.invoke(add_implicit_joins.clj:245)”
“query_processor.middleware.limit$limit$fn__42989.invoke(limit.clj:38)”
“query_processor.middleware.format_rows$format_rows$fn__42970.invoke(format_rows.clj:81)”
“query_processor.middleware.desugar$desugar$fn__42456.invoke(desugar.clj:22)”
“query_processor.middleware.binning$update_binning_strategy$fn__41490.invoke(binning.clj:229)”
“query_processor.middleware.resolve_fields$resolve_fields$fn__41998.invoke(resolve_fields.clj:24)”
“query_processor.middleware.add_dimension_projections$add_remapping$fn__38669.invoke(add_dimension_projections.clj:270)”
“query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__38889.invoke(add_implicit_clauses.clj:147)”
“query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__39282.invoke(add_source_metadata.clj:105)”
“query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__43864.invoke(reconcile_breakout_and_order_by_bucketing.clj:98)”
“query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__41131.invoke(auto_bucket_datetimes.clj:125)”
“query_processor.middleware.resolve_source_table$resolve_source_tables$fn__42045.invoke(resolve_source_table.clj:46)”
“query_processor.middleware.parameters$substitute_parameters$fn__43649.invoke(parameters.clj:97)”
“query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__42097.invoke(resolve_referenced.clj:80)”
“query_processor.middleware.expand_macros$expand_macros$fn__42712.invoke(expand_macros.clj:158)”
“query_processor.middleware.add_timezone_info$add_timezone_info$fn__39313.invoke(add_timezone_info.clj:15)”
“query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__46949.invoke(splice_params_in_response.clj:32)”
“query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__43875$fn__43879.invoke(resolve_database_and_driver.clj:33)”
“driver$do_with_driver.invokeStatic(driver.clj:61)”
“driver$do_with_driver.invoke(driver.clj:57)”
“query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__43875.invoke(resolve_database_and_driver.clj:27)”
“query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__42918.invoke(fetch_source_query.clj:243)”
“query_processor.middleware.store$initialize_store$fn__46958$fn__46959.invoke(store.clj:11)”
“query_processor.store$do_with_store.invokeStatic(store.clj:46)”
“query_processor.store$do_with_store.invoke(store.clj:40)”
“query_processor.middleware.store$initialize_store$fn__46958.invoke(store.clj:10)”
“query_processor.middleware.cache$maybe_return_cached_results$fn__41974.invoke(cache.clj:208)”
“query_processor.middleware.validate$validate_query$fn__46967.invoke(validate.clj:10)”
“query_processor.middleware.normalize_query$normalize$fn__43016.invoke(normalize_query.clj:22)”
“query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__39151.invoke(add_rows_truncated.clj:36)”
“query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__46934.invoke(results_metadata.clj:128)”
“query_processor.middleware.constraints$add_default_userland_constraints$fn__42333.invoke(constraints.clj:42)”
“query_processor.middleware.process_userland_query$process_userland_query$fn__43738.invoke(process_userland_query.clj:136)”
“query_processor.middleware.catch_exceptions$catch_exceptions$fn__42276.invoke(catch_exceptions.clj:174)”
“query_processor.reducible$async_qp$qp_STAR___37952$thunk__37953.invoke(reducible.clj:101)”
“query_processor.reducible$async_qp$qp_STAR___37952$fn__37955.invoke(reducible.clj:106)”],
:context :question,
:error “ERROR: invalid reference to FROM-clause entry for table “tikect_states”\n Hint: Perhaps you meant to reference the table alias “ts”.\n Position: 542”,
:row_count 0,
:running_time 0,
:data {:rows [], :cols []}}

@singular
Please re-read the article again: https://www.metabase.com/blog/field-filters/index.html
You do not write column and operator, when using Field Filters, and you cannot use table aliases.

Here’s information on how to upgrade:
https://www.metabase.com/docs/latest/operations-guide/upgrading-metabase.html

Hello @flamber

Thank you for help

Regards.

Hello @flamber

We found another problem along the query, if we select Field Filter, widget is not available using a “text field” as names (from project). We don’t understand why Metabase doesn’t identify the “filter type” as a category as others fields we have with “names”.

Why appear the message “there aren’t filters widgets for this field yet” ?

Thank you, kind regards.

@singular Make sure that the Field Type in the Data Model is set to one of the following:
https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#creating-sql-question-filters-using-field-filter-variables

Hello @flamber

Great, it works.

Thank you, regards.