Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

calculate value of Column2 on each row using the value of the same column (Column2) from the previous row and using the calculated column in the next row

$
0
0

Hi Guys,

 

I have a requirement where in I have to calculate value of a Column on each row using the value of the same column from the previous row and using the calculated column in the next row in HANA SQL. Refer to the table for more clarity.

 

S.NoDemandIntransitQtyProjected StockRequired Output
110223333First row = Projected Stock 1st row
2200033 + 0 - 20 = 13
315418013 + 418 - 15 = 416
so on..

 

Will appreciate if it can be done without using Cursor as I am creating a scripted view which is taking the values from Graphical CV and then modifying. Using cursor will screw the performance of the model.

 

Regards,

Mohan


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>