Hi, I had similar task and tried to find solution here. I didn't find it, but one of discussion helped me to solve this problem. I understand that it was almost 1 year ago, but it can be helpful for further work .
RowNo() as NumberOfRow,
LET varAmountOfParameter1 = FieldValueCount('Parameter1');
For i = 1 to varAmountOfParameter1
varParameter1 = FieldValue('Parameter1',i);
varNumberOfRow = FieldValue('NumberOfRow',i);
'$(varParameter1)' as varParameter1,
Sum(Amount) as AmountAccumulatively
NumberOfRow <= '$(varNumberOfRow)'
DROP Tables AccumulativeSums, BaseInfo;
As a result we obtain additional column with accumulative amount. I hope it will help .