Trimmed long Column names in native query

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"

the column names like Country/Geographic Risk (highest-risk country where the TPI/BP is based or provides services for WM) (Auto) are cut short to Country/Geographic Risk (highest-risk country where the TPI/BP, anything we can do about that?

Hi @subho
Which version of Metabase?
Which internal database are you using? H2, Postgres or MariaDB/MySQL?
When I make a query in the Sample Dataset, then it shows the column.

I am using Postgres, running on metabase v0.32.4

That’s a specific Postgres thing and nothing to do with Metabase:
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
https://til.hashrocket.com/posts/8f87c65a0a-postgresqls-max-identifier-length-is-63-bytes

As an alternative, you choose not to use the aliases and change the column names in the visualization settings of the Table :gear:

1 Like

Will do that, thanks :+1: