Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello cumunidad
any comment is vienvenido and thanks in advance
I just need to build the "MORTALITY" field into a new field "MORTAcum"
from the scrip. and perform many tests and I get what I need.
IF( EDAD = PREVIOUS(EDAD) AND CVENUC = PREVIOUS(CVENUC),  | ||
| MORTALIDAD + PEEK(MORTAcum), | ||
| MORTALIDAD) | ||
AS MORTAcum  | 
note: note that "CVENUC" are groups
regards

Try Like below in the script:
LOAD * , IF(Previous(CVENUC)=CVENUC , MORTALIDAD+Peek(ACCUMORT) , MORTALIDAD) AS ACCUMORT INLINE [
CVENUC , EDAD ,MORTALIDAD
N001, 1, 0.15
N001, 2, 0.15
N001, 3, 0.15
N002, 1, 0.13
N002, 2, 0.13
N002, 3, 0.13
] ;
If the MORTLIDAD is always same and EDAD is counter, you can create the ACCUMORT by : EDAD*MORTLIDAD AS ACCUMORT
Range Sum Command can use to achieve the same. Please see the your o/p in attached qvw.
Vikas
Try this
on expression side
rangesum(above(sum(MORTALIDAD),0,RowNo(Total)))
hello
appreciate your help are just suggestions for set-analysis and I need it from the scrip
Try Like below in the script:
LOAD * , IF(Previous(CVENUC)=CVENUC , MORTALIDAD+Peek(ACCUMORT) , MORTALIDAD) AS ACCUMORT INLINE [
CVENUC , EDAD ,MORTALIDAD
N001, 1, 0.15
N001, 2, 0.15
N001, 3, 0.15
N002, 1, 0.13
N002, 2, 0.13
N002, 3, 0.13
] ;
If the MORTLIDAD is always same and EDAD is counter, you can create the ACCUMORT by : EDAD*MORTLIDAD AS ACCUMORT