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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum total in a field

Hello,

I need to solve this case

  date         Qt                  tot  

01/01/2011     10            10

02/02/2011     -5               5

03/02/2011     80             85

14/03/2011    -70             15  

I need to put the total value in a field. not in a table.

Please someone could to post the script?

Thanks

regards.

K.

14 Replies
Not applicable
Author

I attached the wtong data result .
Please someone could have an other solution?

Thankyou
Regards,
K.

Jason_Michaelides
Partner - Master II
Partner - Master II

Have you tried lucas4bi's solution?

Not applicable
Author

No , I don't.

please  the solution should be with a field thath contains the progressive total .

Thanks.

K.

Jason_Michaelides
Partner - Master II
Partner - Master II

Here you go - should be working now.  You need to reset the Peek() on every change of Item:

Data:

LOAD * INLINE [

          post, item , QTY

          01/01/2011 , AAA, 100

          05/01/2011 , CCC, 26

          07/01/2011 , CCC, -4

          02/01/2011 , AAA ,-16

          03/01/2011, AAA, -4

          05/01/2011, FFF,70

] ;

Data_Ordered:

NoConcatenate

LOAD

          post

          ,item

          ,QTY

RESIDENT Data

ORDER BY  item, post;

DROP TABLE Data;

Data_Final:

NoConcatenate

LOAD

          post

          ,item

          ,QTY

          ,IF(item=Previous(item),NumSum(Peek('QTY_Accum'),QTY),QTY) as QTY_Accum

RESIDENT Data_Ordered ;

DROP TABLE Data_Ordered;

I've attached the file for you - hope it's what you're looking for.

Jason

Not applicable
Author

Many thanks.

I will try this  in real Application.

Bye

K.