cancel
Showing results for 
Search instead for 
Did you mean: 

Reverse Sums

hoffmanroni
New Contributor III
Hello,

I have table something like

num
0N
0N
0N
1
0N
0N
3
0N
0N
4


and I want to have the sums going backwards, so the output would look like

num
8
8
8
8
7
7
7
4
4
4


I've tried using reverse fills, reverse sums, ect.. but can't get it quite right
anyone have any ideas?

2 REPLIES 2

Jamie_O__Mahony
New Contributor
New Contributor
Correction:

q)select reverse sums reverse num from t

num

---

8  

8  

8  

8  

7  

7  

7  

4  

4  

4  


On Friday, July 28, 2017 at 7:34:44 AM UTC-4, Roni Hoffman wrote:
Hello,

I have table something like

num
0N
0N
0N
1
0N
0N
3
0N
0N
4


and I want to have the sums going backwards, so the output would look like

num
8
8
8
8
7
7
7
4
4
4


I've tried using reverse fills, reverse sums, ect.. but can't get it quite right
anyone have any ideas?

Thanks! yea was having issues with the first suggestion, this works perfectly.  Cheers.