you could use peek() function to retrieve a field value from previous record, this allows you to accumulate, like
Acumm as Acumm_Ref
(html, codepage is 1252, embedded labels, table is @1);
if(peek(Accountnum)=Accountnum and peek([Año_Acum])=[Año_Acum],peek(Acum_Importe)+Importe,Importe) as Acum_Importe
resident INPUT order by Accountnum, [Año_Acum] asc, [Mes_Acum] asc;
drop table INPUT;
As I understood your request, I start the accumulation for each account and per year. If you don't want to reset the accumulation on a year change, just remove the "and peek([Año_Acum])=[Año_Acum]" from above if statement.
Hope this helps,
Yes, your input table INPUT doesn't have this field. That's the new field we create which will hold the accumulated value for Importe (You could rename it of course, in both places).
We can reference this field with peek(), even if it's not part of the input record, because peek() accesses the resident table we create in QV.