I have a table and I’m trying to calculate the ttl members by day. See an example table below. The ttl_members is the column I am trying to calculate. change_in_members, ttl_members 22, 29 -1, 7 3, 8 5, 5 Here’s my attempt “change_in_members + lag(ttl_members, 1, 0) OVER (ORDER BY dt) AS ttl_members” However, since I am calculating on a column that is not yet created, I get the error ORA-00904: “TTL_MEMBERS”: invalid identifier. Any ideas how to do this?