I want to nest max functions in bigquery.
Sample-
Max(a,Max(b,Max(c,d)))
It is giving an error of invalid arguments. So, what I tried is the Greatest function
Greatest(a,b,c,d). But the issue with Greatest function is that, it will return null if any of the values is null. But What I wanted is that, It should return Greatest value even if any of the values is null.
For Example-
Greatest(1,3,4,null)- It should return 4
Greatest(null,null,null)- It should return null

