Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: how to calculate the cumulative sum with certain interval in SAP HANA

$
0
0

Hi Sreehari,

 

I will simplify the requirement , below is the sample data, the explanation of the calculation involved,

 

ID          Date                           column 1          Cumulative sum       Comment

1          9-14-2014 14:05:00          1                    1     (col1) =1

1          9-14-2014 14:22:00          1                    2     (col1+previous cumulative sum) =1+1

1          9-14-2014 14:25:00          1                    3     (col1+Previous cumulative sum) =1+2

1          9-14-2014 14:37:00          0                    0     (col1)=0

1          9-14-2014 15:02:00          0                    0     (col1)=0

1          9-14-2014 15:12:00          1                    1     (col1)=1

1          9-14-2014 15:18:00          1                    2     (col1+previous cumulative sum)=1+1

1          9-14-2014 15:21:00          1                    3     (col1+previous cumulative sum)=1+2


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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