Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Expert
I want to use the peek function to acumulutae values in the script, and if i do not have value to one month, take the acumuluate and create a value that bring the previous (peek) value that i have in the table
for example
Retail 01-2010 100
Retail 02-2010 0
Retail 03-2010 50
Bank 01-2010 140
Bank 02-2010 0
I want something like this
Retail 01-2010 100
Retail 02-2010 100
Retail 03-2010 150
Bank 01-2010 140
Bank 02-2010 140
i attached and image that i have result and the qvd is simple only few register and field
i am using the peek, but i am sure i have an errror
thank you a lot
Fernando K.
This may be:
Table:
LOAD Date(Date#(%MesAño, 'MM-YYYY'), 'MM-YYYY') as %MesAño,
Actividad,
SuperficieTotalxActividad
FROM
ValuesAcumulate.qvd
(qvd);
Join (Table)
LOAD Actividad,
%MesAño,
If(Actividad = Previous(Actividad), RangeSum(Peek('Test'), SuperficieTotalxActividad), SuperficieTotalxActividad) as Test
Resident Table
Order By Actividad, %MesAño;
This may be:
Table:
LOAD Date(Date#(%MesAño, 'MM-YYYY'), 'MM-YYYY') as %MesAño,
Actividad,
SuperficieTotalxActividad
FROM
ValuesAcumulate.qvd
(qvd);
Join (Table)
LOAD Actividad,
%MesAño,
If(Actividad = Previous(Actividad), RangeSum(Peek('Test'), SuperficieTotalxActividad), SuperficieTotalxActividad) as Test
Resident Table
Order By Actividad, %MesAño;
Hi,
IF(ROWNO()=1,
Value,
Peek(total,-1)+ (total)
) as total
Mark