Replacing missing value with next vaules

Analytics
N/A

Replacing missing value with next vaules

I have a data like

Attmpt_dt

1/1/2016

?

?

?

?

1/10/2016

?

?

?

1/31/2016

I want it to covert 

Attmpt_dt

1/1/2016

1/10/2016

1/10/2016

1/10/2016

1/10/2016

1/10/2016

1/31/2016

1/31/2016

1/31/2016

1/31/2016

So, I am replaceing every missing value with the next known date. How to do it in teradata. Thank you in advance for help.

1 REPLY
N/A

Re: Replacing missing value with next vaules

Assuming that the rows are sorted by date it's a simple MAX(Attmpt_dt) OVER (ORDER BY sortcolumn).

Otherwise you need LAST_VALUE (Attmpt_dt IGNORE NULLS) OVER (ORDER BY sortcolumn)