Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

accumulation of data

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

2.png

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

4 Replies
vikasmahajan

Range Sum Command can use to achieve the same. Please see the your o/p in attached qvw.

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
er_mohit
Master II
Master II

Try this

on expression side

rangesum(above(sum(MORTALIDAD),0,RowNo(Total)))

Not applicable
Author

hello

appreciate your help are just suggestions for set-analysis and I need it from the scrip

Not applicable
Author

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