Using Saved questions as source on Custom Query

I have around 19 questions out of which only 14 shows up in the custom view , I am aware of the source limitations https://metabase.com/docs/latest/users-guide/04-asking-questions.html#source-data , i am using postgres, not using any cumulative queries and i have already removed the duplicate columns. Still the questions wont show up. Any resolution?

UPDATE:
It did show up but took some time, do i need to invalidate some metadata cache to make it visible immediately? there are other queries that match with all the requirements above but still dont appear in the saved question dropdown in custom query source

Using metabase version v0.32.1

Hi @subho
Which version of Metabase?
Do you see any hints in the logs?
Can you post a query for working and non-working?

Nothing in the logs, i didnt even see any api call to fetch this list when i clicked the dropdown

Newest version is 0.32.4 - and 0.32.5 is probably coming very soon. Not that it will fix this issue specifically.
There are some lists, which don’t get updated until you do a browser refresh, so if they’re showing up now, then it might just have been that. There are a couple of issues open about this.

@flamber

select 
null as "RR Config Name", 
null as "RR Calc Config Name", 
coalesce(summary_pid.answer, summary_pid_nomatch.answer) as PID,
division.answer as "Division", 
sub_division.answer as "Sub Division", 
kws.label as "Current Queue", 
entity_name.answer as "Customer provided entity name", 
null as "Rating Calc Date_Time Stamp", 
null as "Ranking Calc Date_Time Stamp", 
null as "Is Final Rating current?", 
total_points.answer as "Total Points (Auto)",
tpi_risk_level.answer as "TPI Risk Level as Calculated by Model (Auto)",
final_risk_level.answer as "Final Risk Level After Manual Upward Adjustment (Auto)",
risk_assessment.answer as "Risk Assessment (Auto)", 
ranking_id.answer as "Ranking ID (Auto)", 
rank_fs.answer as "Rank",
compensation_arrangement_risk_cf.answer as "Compensation Arrangement Risk (Auto)", 
country_risk_cf.answer as "Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM) (Auto)",
other_tpi_bpi_risk_cf.answer as "Other TPI/BP-Specific Red Flags (Auto)",
freq_of_govt_interaction_cf.answer as "Frequency of Government Interaction (Auto)",
tpi_bp_annual_spend_cf.answer as "TPI/BP Annual Spend (expected values for new TPI/BPs) (Auto)",
tpi_points.answer as "TPI Points (Auto)",
category_points.answer as "Category Points (Auto)",
category_risk_rating.answer as "Category Risk Ranking (Auto)",
principal_functional_category.answer as "Principal Functional Category For Risk Assessment (Menu)",
secondary_functional_category.answer as "Secondary Functional Category For Risk Assessment (Menu)",
additional_functional_category.answer as "Additional Functional Category For Risk Assessment (Menu)",
compensation_arrangement_risk.answer as "Compensation Arrangement Risk (Menu)",
country_risk.answer as "Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM)",
other_tpi_bpi_risk.answer as "Other TPI/BP-Specific Red Flags (Menu)",
freq_of_govt_interaction.answer as "Frequency of Government Interaction (Menu)",
tpi_bp_annual_spend.answer as "TPI/BP Annual Spend(expected values for new TPI/BPs)",
null as "Manual Upward Adjustment"

These are the selected columns from one of my queries where it doesnt appear in the source dropdown in custom query.

But if it already shows up in the list now, then it’s probably just a cache issue.

So @flamber there were total 19 questions, out of which 14 were visible

Scenario 1:
1 of them started showing up after sometime/browser refresh.

Scenario 2:

select 
null as "RR Config Name", 
null as "RR Calc Config Name", 
coalesce(summary_pid.answer, summary_pid_nomatch.answer) as PID,
division.answer as "Division", 
sub_division.answer as "Sub Division", 
kws.label as "Current Queue", 
entity_name.answer as "Customer provided entity name", 
null as "Rating Calc Date_Time Stamp", 
null as "Ranking Calc Date_Time Stamp", 
null as "Is Final Rating current?", 
total_points.answer as "Total Points (Auto)",
tpi_risk_level.answer as "TPI Risk Level as Calculated by Model (Auto)",
final_risk_level.answer as "Final Risk Level After Manual Upward Adjustment (Auto)",
risk_assessment.answer as "Risk Assessment (Auto)", 
ranking_id.answer as "Ranking ID (Auto)", 
rank_fs.answer as "Rank",
compensation_arrangement_risk_cf.answer as "Compensation Arrangement Risk (Auto)", 
country_risk_cf.answer as "Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM) (Auto)",
other_tpi_bpi_risk_cf.answer as "Other TPI/BP-Specific Red Flags (Auto)",
freq_of_govt_interaction_cf.answer as "Frequency of Government Interaction (Auto)",
tpi_bp_annual_spend_cf.answer as "TPI/BP Annual Spend (expected values for new TPI/BPs) (Auto)",
tpi_points.answer as "TPI Points (Auto)",
category_points.answer as "Category Points (Auto)",
category_risk_rating.answer as "Category Risk Ranking (Auto)",
principal_functional_category.answer as "Principal Functional Category For Risk Assessment (Menu)",
secondary_functional_category.answer as "Secondary Functional Category For Risk Assessment (Menu)",
additional_functional_category.answer as "Additional Functional Category For Risk Assessment (Menu)",
compensation_arrangement_risk.answer as "Compensation Arrangement Risk (Menu)",
country_risk.answer as "Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM)",
other_tpi_bpi_risk.answer as "Other TPI/BP-Specific Red Flags (Menu)",
freq_of_govt_interaction.answer as "Frequency of Government Interaction (Menu)",
tpi_bp_annual_spend.answer as "TPI/BP Annual Spend(expected values for new TPI/BPs)",
null as "Manual Upward Adjustment"

This is not showing up.

Scenario 3:
another query which already is 1 level nested is not showing up (which might be intentional)

Try removing or renaming all those aliases to something much shorter. Does that make it show up?
And there’s nothing in the browser console or Metabase log?

Okay realised what happened here, due to postgres column length limitation, the column country_risk_cf.answer as "Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM) (Auto)" and column country_risk.answer as "Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM)" were both trimmed to Country/Geographic Risk (highest-risk country where the TPI/BP resulting in two columns having same name. Changing the alias to identifiable short tags in sql and Renaming the columns from UI worked. Thanks a ton :pray:

1 Like