Skip to content
Advertisement

Cumulative sum of a column

I have a table that has the below data.

I wrote a query that will calculate the sum of cumulative rows and got the below output .

Now I want to to filter the data and take only where the POOL <=300, if the POOL field does not have the value 300 then I should take the first value after 300. So, in the above example we do not have the value 300 in the field POOL, so we take the next immediate value after 300 which is 392. So I need a query so that I can pull the records POOL <= 392(as per the example above) which will yield me the output as

Please let me know your thoughts. Thanks in advance.

Advertisement

Answer

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement