Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
I attached the wtong data result .
Please someone could have an other solution?
Thankyou
Regards,
K.
Have you tried lucas4bi's solution?
No , I don't.
please the solution should be with a field thath contains the progressive total .
Thanks.
K.
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
Many thanks.
I will try this in real Application.
Bye ![]()
K.