Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to add two values
i have attached a snap of my file in that i want an expression which will add two values
For ex: for Material 1011 and week 2 the Avail.qty is 500 so now i want to add "Req. qty from the row below it +Avail.qty above that row" how would i do it??
if you consider the first row then
Avail.qty=500
And Req.qty below that row is =10
i want to add 500+10= 510 (Since Req.qty is +10)
AND
if you consider 2nd row for Avail.qty then
Avail. qty= 510
And Req.qty below that row is = -2
i want to add 510+(-2)= 508 (basically depending upon the sign of Req.qty ,the rows of Req.qty below the particular Avail.qty should get added or subtracted)
& so on...
Material | Deli. date | week | elements | Req. qty | Avail.qty |
1011 | 09-01-19 | 2 | A | -5 | 500 |
1011 | 11-01-19 | 2 | B | 10 | 510 |
1011 | 04-02-19 | 6 | A | -2 | 508 |
1011 | 05-02-19 | 6 | A | -10 | 498 |
1011 | 05-02-19 | 6 | A | -1 | 497 |
1011 | 05-02-19 | 6 | A | -2 | 495 |
1011 | 05-02-19 | 6 | A | -5 | 490 |
1011 | 05-02-19 | 6 | A | -8 | 482 |
1011 | 05-02-19 | 6 | A | -100 | 382 |
1012 | 09-01-19 | 2 | A | 10 | 500 |
1012 | 11-01-19 | 2 | B | 30 | 530 |
1012 | 04-02-19 | 6 | A | 40 | 570 |
1012 | 05-02-19 | 6 | A | -20 | 550 |
Try this.
Data:
LOad * inline [
Material,Deli. date,week,elements,Req. qty,Avail.qty
1011,43709,2,A,-5,500
1011,43770,2,B,10,
1011,43557,6,A,-2,
1011,43587,6,A,-10,
1011,43587,6,A,-1,
1011,43587,6,A,-2,
1011,43587,6,A,-5,
1011,43587,6,A,-8,
1011,43587,6,A,-100,
1012,43709,2,A,10,500
1012,43770,2,B,30,
1012,43557,6,A,40,
1012,43587,6,A,-20,
];
Temp:
Load *,AutoNumber(Rowno(),Material) as Rownum Resident Data;
Final:
Load *,If(Rownum = 1,"Avail.qty",(Peek(NewQTY)+"Req. qty")) as NewQTY Resident Temp;
Drop table Data,Temp;
Regards,
Kaushik Solanki
Will you please tell me which chart functions to use since i have attached data through Data Manager and not the data load editor.