Skip to content
Advertisement

Bigquery SQL MAX() text value

Thanks for taking the time to look at this.

How to get the MAX of a text value in column A. I would like to and another where clause to show only one of the “FY20-Q4M#” (MAX value only)

Current Table

YY-QQ_STATUS Program
FY20-Q2_ACTUALS XYZ
FY20-Q3_ACTUALS XYZ
FY20-Q3_BUDGET XYZ
FY20-Q4M0 XYZ
FY20-Q4M1 XYZ
FY20-Q4M2 XYZ
FY20-Q4_BUDGET XYZ
FY20-Q4_OUTLOOK XYZ

Goal:

YY-QQ_STATUS Program
FY20-Q2_ACTUALS XYZ
FY20-Q3_ACTUALS XYZ
FY20-Q3_BUDGET XYZ
FY20-Q4M2 XYZ
FY20-Q4_BUDGET XYZ
FY20-Q4_OUTLOOK XYZ

Advertisement

Answer

Try below

if applied to sample data in y our question – output is

enter image description here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement