Field Filter Error ERROR: missing FROM-clause entry for table x

I have been working around using a field filter for a native query in Postgresql but I have been facing the error of ERROR: missing FROM-clause entry for table...
Where should I use FROM-Clause is this query and what does this error come from?


:query
"SELECT "source"."reinsurer_company_name" AS "reinsurer_company_name", "source"."ratio" AS "ratio"\nFROM (select TblA.reinsurer_company_name, 1.0TblA.count/TblB.count as ratio from\n(select count() as count, reinsurer_company_name from quote_reports\nwhere status = 'accepted'\n \n OR "status" = 'certificate_of_reinsurance_accepted' OR "status" = 'certificate_of_reinsurance_issued' OR "status" = 'bound' OR "status" = 'insurance_policy_requested' OR "status" = 'binder_requested' OR "status" = 'binding' OR "status" = 'issued'\ngroup by reinsurer_company_name) as TblA\ninner join\n(select count(*) as count, reinsurer_company_name from quote_reports\nwhere status = 'accepted'\n OR "status" = 'binder_requested' OR "status" = 'binding' OR "status" = 'bound' OR "status" = 'certificate_of_reinsurance_accepted' OR "status" = 'certificate_of_reinsurance_issued' OR "status" = 'client_approved' OR "status" = 'awaiting_response' OR "status" = 'insurance_policy_requested' OR "status" = 'issued' OR "status" = 'outdated' OR "status" = 'proposal_accepted' OR "status" = 'proposal_declined' OR "status" = 'proposed' OR "status" = 'quoted' OR "status" = 'selected'\ngroup by reinsurer_company_name) as TblB\non TblA.reinsurer_company_name = TblB.reinsurer_company_name\n\n) "source"\nWHERE ("source"."reinsurer_company_name" = 'Chubb' OR "source"."reinsurer_company_name" = 'Cowbell' OR "source"."reinsurer_company_name" = 'CFC' OR "source"."reinsurer_company_name" = 'Corvus' OR "source"."reinsurer_company_name" = 'Coalition')\n[[and {{created_at}}]]\nORDER BY "source"."ratio" DESC\nLIMIT 1048575"},
:type "native",
:parameters [{:type "date/all-options", :value "past3months~", :target ["dimension" ["template-tag" "created_at"]]}],
:middleware {:js-int-to-string? true, :add-default-userland-constraints? true}},
:status :failed,
:class org.postgresql.util.PSQLException,
:stacktrace
["org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2552)"
"org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2284)"
"org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:322)"
"org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481)"
"org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401)"
"org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)"
"org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)"
"com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:431)"
"--> driver.sql_jdbc.execute$fn__40661.invokeStatic(execute.clj:364)"
"driver.sql_jdbc.execute$fn__40661.invoke(execute.clj:362)"
"driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invokeStatic(execute.clj:377)"
"driver.sql_jdbc.execute$execute_statement_or_prepared_statement_BANG_.invoke(execute.clj:373)"
"driver.sql_jdbc.execute$execute_reducible_query$fn__40743.invoke(execute.clj:502)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:501)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
"driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:496)"
"driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:487)"
"driver.sql_jdbc$fn__89984.invokeStatic(sql_jdbc.clj:54)"
"driver.sql_jdbc$fn__89984.invoke(sql_jdbc.clj:52)"
"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:68)"
"query_processor.context.default$default_runf.invoke(default.clj:66)"
"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__50076.invoke(mbql_to_native.clj:25)"
"query_processor.middleware.check_features$check_features$fn__50562.invoke(check_features.clj:39)"
"query_processor.middleware.limit$limit$fn__48449.invoke(limit.clj:37)"
"query_processor.middleware.cache$maybe_return_cached_results$fn__50936.invoke(cache.clj:204)"
"query_processor.middleware.optimize_temporal_filters$optimize_temporal_filters$fn__51929.invoke(optimize_temporal_filters.clj:204)"
"query_processor.middleware.validate_temporal_bucketing$validate_temporal_bucketing$fn__51973.invoke(validate_temporal_bucketing.clj:50)"
"query_processor.middleware.auto_parse_filter_values$auto_parse_filter_values$fn__50133.invoke(auto_parse_filter_values.clj:43)"
"query_processor.middleware.wrap_value_literals$wrap_value_literals$fn__36905.invoke(wrap_value_literals.clj:161)"
"query_processor.middleware.annotate$add_column_info$fn__42046.invoke(annotate.clj:620)"
"query_processor.middleware.permissions$check_query_permissions$fn__46550.invoke(permissions.clj:108)"
"query_processor.middleware.pre_alias_aggregations$pre_alias_aggregations$fn__51113.invoke(pre_alias_aggregations.clj:40)"
"query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__46948.invoke(cumulative_aggregations.clj:60)"
"metabase_enterprise.sandbox.query_processor.middleware.row_level_restrictions$apply_row_level_permissions$fn__87863.invoke(row_level_restrictions.clj:338)"
"query_processor.middleware.visualization_settings$update_viz_settings$fn__46886.invoke(visualization_settings.clj:63)"
"query_processor.middleware.resolve_joined_fields$resolve_joined_fields$fn__48047.invoke(resolve_joined_fields.clj:102)"
"query_processor.middleware.resolve_joins$resolve_joins$fn__51699.invoke(resolve_joins.clj:171)"
"query_processor.middleware.add_implicit_joins$add_implicit_joins$fn__51235.invoke(add_implicit_joins.clj:190)"
"query_processor.middleware.large_int_id$convert_id_to_string$fn__48066.invoke(large_int_id.clj:59)"
"query_processor.middleware.format_rows$format_rows$fn__51287.invoke(format_rows.clj:74)"
"query_processor.middleware.add_default_temporal_unit$add_default_temporal_unit$fn__47438.invoke(add_default_temporal_unit.clj:23)"
"query_processor.middleware.desugar$desugar$fn__46859.invoke(desugar.clj:21)"
"query_processor.middleware.binning$update_binning_strategy$fn__45800.invoke(binning.clj:229)"
"query_processor.middleware.resolve_fields$resolve_fields$fn__46193.invoke(resolve_fields.clj:34)"
"query_processor.middleware.add_dimension_projections$add_remapping$fn__50488.invoke(add_dimension_projections.clj:312)"
"query_processor.middleware.add_implicit_clauses$add_implicit_clauses$fn__50785.invoke(add_implicit_clauses.clj:147)"
"metabase_enterprise.sandbox.query_processor.middleware.row_level_restrictions$apply_row_level_permissions$fn__87863.invoke(row_level_restrictions.clj:338)"
"query_processor.middleware.upgrade_field_literals$upgrade_field_literals$fn__48434.invoke(upgrade_field_literals.clj:40)"
"query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__47815.invoke(add_source_metadata.clj:123)"
"metabase_enterprise.sandbox.query_processor.middleware.column_level_perms_check$maybe_apply_column_level_perms_check$fn__86249.invoke(column_level_perms_check.clj:30)"
"query_processor.middleware.reconcile_breakout_and_order_by_bucketing$reconcile_breakout_and_order_by_bucketing$fn__51035.invoke(reconcile_breakout_and_order_by_bucketing.clj:100)"
"query_processor.middleware.auto_bucket_datetimes$auto_bucket_datetimes$fn__49385.invoke(auto_bucket_datetimes.clj:147)"
"query_processor.middleware.resolve_source_table$resolve_source_tables$fn__46174.invoke(resolve_source_table.clj:45)"
"query_processor.middleware.parameters$substitute_parameters$fn__49039.invoke(parameters.clj:111)"
"query_processor.middleware.resolve_referenced$resolve_referenced_card_resources$fn__46247.invoke(resolve_referenced.clj:79)"
"query_processor.middleware.expand_macros$expand_macros$fn__52357.invoke(expand_macros.clj:184)"
"query_processor.middleware.add_timezone_info$add_timezone_info$fn__48818.invoke(add_timezone_info.clj:15)"
"query_processor.middleware.splice_params_in_response$splice_params_in_response$fn__51302.invoke(splice_params_in_response.clj:32)"
"query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__50796$fn__50800.invoke(resolve_database_and_driver.clj:31)"
"driver$do_with_driver.invokeStatic(driver.clj:60)"
"driver$do_with_driver.invoke(driver.clj:56)"
"query_processor.middleware.resolve_database_and_driver$resolve_database_and_driver$fn__50796.invoke(resolve_database_and_driver.clj:25)"
"query_processor.middleware.fetch_source_query$resolve_card_id_source_tables$fn__46797.invoke(fetch_source_query.clj:274)"
"query_processor.middleware.store$initialize_store$fn__46985$fn__46986.invoke(store.clj:11)"
"query_processor.store$do_with_store.invokeStatic(store.clj:44)"
"query_processor.store$do_with_store.invoke(store.clj:38)"
"query_processor.middleware.store$initialize_store$fn__46985.invoke(store.clj:10)"
"query_processor.middleware.validate$validate_query$fn__51085.invoke(validate.clj:10)"
"query_processor.middleware.normalize_query$normalize$fn__51092.invoke(normalize_query.clj:22)"
"query_processor.middleware.add_rows_truncated$add_rows_truncated$fn__48764.invoke(add_rows_truncated.clj:35)"
"metabase_enterprise.audit_app.query_processor.middleware.handle_audit_queries$handle_internal_queries$fn__40911.invoke(handle_audit_queries.clj:130)"
"query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__50062.invoke(results_metadata.clj:147)"
"query_processor.middleware.constraints$add_default_userland_constraints$fn__48782.invoke(constraints.clj:42)"
"query_processor.middleware.process_userland_query$process_userland_query$fn__51071.invoke(process_userland_query.clj:146)"
"query_processor.middleware.catch_exceptions$catch_exceptions$fn__51382.invoke(catch_exceptions.clj:169)"
"query_processor.reducible$async_qp$qp_STAR___40199$thunk__40200.invoke(reducible.clj:103)"
"query_processor.reducible$async_qp$qp_STAR___40199.invoke(reducible.clj:109)"
"query_processor.reducible$sync_qp$qp_STAR___40208$fn__40211.invoke(reducible.clj:135)"
"query_processor.reducible$sync_qp$qp_STAR___40208.invoke(reducible.clj:134)"
"query_processor$process_userland_query.invokeStatic(query_processor.clj:243)"
"query_processor$process_userland_query.doInvoke(query_processor.clj:239)"
"query_processor$fn__52405$process_query_and_save_execution_BANG___52414$fn__52417.invoke(query_processor.clj:255)"
"query_processor$fn__52405$process_query_and_save_execution_BANG___52414.invoke(query_processor.clj:247)"
"query_processor$fn__52449$process_query_and_save_with_max_results_constraints_BANG___52458$fn__52461.invoke(query_processor.clj:267)"
"query_processor$fn__52449$process_query_and_save_with_max_results_constraints_BANG___52458.invoke(query_processor.clj:260)"
"api.dataset$run_query_async$fn__58593.invoke(dataset.clj:64)"
"query_processor.streaming$streaming_response_STAR_$fn__44709$fn__44710.invoke(streaming.clj:159)"
"query_processor.streaming$streaming_response_STAR_$fn__44709.invoke(streaming.clj:158)"
"async.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:65)"
"async.streaming_response$do_f_STAR_.invoke(streaming_response.clj:63)"
"async.streaming_response$do_f_async$fn__25088.invoke(streaming_response.clj:84)"],
:card_id nil,
:context :ad-hoc,
:error "ERROR: missing FROM-clause entry for table "quote_reports"\n Position: 1649",
:row_count 0,
:running_time 0,
:data {:rows [], :cols []}}

Hi @aramit
You cannot use table aliases with Field Filters:
https://www.metabase.com/learn/sql-questions/field-filters#field-filters-are-incompatible-with-aliasing