Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
fkeuroglian
Partner - Master
Partner - Master

Accumulate in the script

Hi expert!

I have to create a accumulate value month by month. but my problem is that i use the peek function but there is some month that i do not have any value, and i want to acumulate not only the previous field, i want to acumulate all

for example:

Jan 2015      10

Feb 2015       5

Apr 2015      15

Jul 2015       40

I would like

Jan 2015   10

Feb 2015   15

Apr 2015    30

Jul 2016    70

i use this, but only sum the previous register

SAEC_ACUMULADA:

load *,

Peek('SuperficieTotal')+ SuperficieTotal as Acumulada

Resident SAEC_AGRUPADA;

what is the best way to do this?

thank you a lot

Fernando

attach an image and the qvw and qvd for example

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Try this..

Load *,

      [Superficie Total]+if (isnull (peek ('Acumulada')),0,peek ('Acumulada')) as Acumulada

Resident SAEC_AGRUPADA Order by MonthField;

View solution in original post

1 Reply
settu_periasamy
Master III
Master III

Try this..

Load *,

      [Superficie Total]+if (isnull (peek ('Acumulada')),0,peek ('Acumulada')) as Acumulada

Resident SAEC_AGRUPADA Order by MonthField;