I have this code in tableau which I need to convert to Redshift SQL
(
zn(
sum([Market_Price])
)-
zn(
sum(
if ISNULL([Market_Price]) then null else [Initial_Price] end
)
))/
zn(sum([Market_Price]))
I have tried but not getting the same results.
Do we have isnull and zn equivalent in Redshift?
2
Answers
You can replace zn(X) with nvl(X,0)
Something like this should work