Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

Re: How to calculate a cumulative total in HANA

$
0
0

I am looking for a similar solution, but I think your approach has a flaw in it.

 

Due to the fact that you have to group by a numeric column ("TotalAmount_E"), in the case that you have two transactions that occur on the same day for the same amount only ONE will be counted.

 

Example data

 

Date          Amount          YTD          
1/1/2015    100                100

1/2/2015    200                300

1/2/2015    200                300 <-- Same date, same amount NOT COUNTED

 

The level of uniqueness needs to be more detailed since the group by "AMOUNT" column can be duplicated and you WANT to count those too.

 

Regards,

Justin


Viewing all articles
Browse latest Browse all 9069

Trending Articles



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