Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Need to find the previous balance and the balance by.
ordey by
Branch,
product,
Date,
Ordem
Ramo | produtos | Encontro | Ordem | Tipo | Seq | entrada | saída |
7 | 1108711806 | 26/01/2021 13:28 | 6642152 | E | 199979 | 3 | 0 |
7 | 1108711806 | 23/02/2021 15:39 | 6735358 | S | 201684 | 0 | 1 |
7 | 1108711806 | 03/05/2021 09:27 | 6914042 | S | 205894 | 0 | 1 |
7 | 1108711806 | 19/07/2021 09:49 | 7184126 | E | 212199 | 1 | 0 |
7 | 1108711806 | 09/08/2021 15:43 | 7257623 | S | 213854 | 0 | 1 |
7 | 1108711806 | 09/08/2021 15:43 | 7257624 | S | 213854 | 0 | 1 |
18 | 1108711806 | 26/01/2021 16:39 | 6639619 | E | 71806 | 3 | 0 |
18 | 1108711806 | 15/07/2021 18:12 | 7169434 | S | 85888 | 0 | 1 |
18 | 1108711806 | 08/10/2021 16:54 | 7261373 | E | 87937 | 0 | 2 |
2 | 8101151606 | 01/05/2010 19:55 | 455234 | E | 0 | 1 | 0 |
2 | 8101151606 | 22/04/2010 17:52 | 508359 | E | 0 | 0 | 2 |
2 | 8101151606 | 14/01/2011 12:16 | 435600 | S | 0 | 1 | 0 |
how i want!
Branch | product | Date | Ordem | Type | Seq | Previous | input | exit | balance |
7 | 1108711806 | 26/01/2021 13:28 | 6642152 | E | 199979 | 0 | 3 | 0 | 3 |
7 | 1108711806 | 23/02/2021 15:39 | 6735358 | S | 201684 | 3 | 0 | 1 | 2 |
7 | 1108711806 | 03/05/2021 09:27 | 6914042 | S | 205894 | 2 | 0 | 1 | 1 |
7 | 1108711806 | 19/07/2021 09:49 | 7184126 | E | 212199 | 1 | 1 | 0 | 2 |
7 | 1108711806 | 09/08/2021 15:43 | 7257623 | S | 213854 | 2 | 0 | 1 | 1 |
7 | 1108711806 | 09/08/2021 15:43 | 7257624 | S | 213854 | 1 | 0 | 1 | 0 |
18 | 1108711806 | 26/01/2021 16:39 | 6639619 | E | 71806 | 0 | 3 | 0 | 3 |
18 | 1108711806 | 15/07/2021 18:12 | 7169434 | S | 85888 | 3 | 0 | 1 | 2 |
18 | 1108711806 | 10/08/2021 16:54 | 7261373 | E | 87937 | 2 | 0 | 2 | 1 |
2 | 8101151606 | 05/01/2010 19:55 | 455234 | E | 0 | 0 | 1 | 0 | 1 |
2 | 8101151606 | 22/04/2010 17:52 | 508359 | E | 0 | 1 | 0 | 2 | 3 |
2 | 8101151606 | 14/01/2011 12:16 | 435600 | S | 0 | 3 | 1 | 0 | 2 |
Table:
Load
Branch, product,Date,Order,Type,Seq,input,exit
,If(Product=Peek('Product'),Peek('Balance'),0)as Previous
,If(Product=Peek('Product')
,Peek('Balance')+input-exit
,Input-exit ) as Balance
From yourdata;
Table:
Load
Branch, product,Date,Order,Type,Seq,input,exit
,If(Product=Peek('Product'),Peek('Balance'),0)as Previous
,If(Product=Peek('Product')
,Peek('Balance')+input-exit
,Input-exit ) as Balance
From yourdata;
😀 trank