Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Problems Extracting the last value form a column

Hello to everyone.

I´m writing because I have a problem extracting the last value of a filed.

This is the error that I got and I don´t know how to fix it.

integer_2.jpg

As the graphic shows the field is "integer".  and the result should look like this 

Output.PNG

thank you 

 

 

0 2 273
2 REPLIES 2

Could you please provide what error is bigquery returning you sou? Since the image is very small, but I can see that you are trying to make use of the string functions you can read more on the documentation I shared with you.

Hi, 

Below is the solution for the same. You can use DIV Function or

SUBSTRING Function, if using string functions you have to CAST the value to STRING type. Here I am using SAFE_CAST instead of CAST function to handle NULLs.

darsh_shukla_0-1676467051462.png