We have some records coming from another source counting the amount of members. However, sometimes the members does not get tracked and then goes to zero. The problem is is we have another column calculating the amount of new members. When the total members goes to zero then new members is a huge negative number. How would I write a statement that grabs the last non- zero number in a column and inserts it where there is a zero. For example we could have ttl_memeber, new_members as 10,1 9,1 8,1 0,0 0,-5 5,1 4,1 0,0 0,-1 1,0 What I want (since we are guessing the data will still not be 100% accurate ttl_memeber, new_members as 10,1 9,1 8,2 6,0 6,1 5,1 4,3 1,0 1,0 1,0 This way we would at least get the right amount (9) of new members by summing the new_member column as opposed to the amount from before (-1) My first attempt was to do a case statement and make a new column with the adjusted values. CASE when ttl_members = 0 THEN lag(ttl_members,1,0) OVER(ORDER BY date) ELSE ttl_members END This however only works for one missing number, and I am not sure how to select from the new values entered. Ideas?