Forum Discussion
Akos07
4 years agoHelper I
Stock quantity counting help
Hi, I have the following problem. My matrix countains products, currentstock at time, and current price at the time. As you can see, this product started with 40 stock, and gets low...
- 4 years ago
Hi, i found the solotion. In the item table for each row i created a new cumulative sum column. After that, i created a measure that gets me the max ID for each date. After that i know the row with the quantity i am looking for.
Akos07
4 years agoHelper I
| DocumentHeaderId | DocumentNumber | StoreId | WarehouseId | DocumentDate | FulfillmentDate | NetValue | GrossValue | MovementId | Direction | DirectionStr | MovementTypeStr | PartnerId | PartnerCode | PartnerName | PartnerShortName |
| 2 | BSZ22-PC-0001 | 2 | 3 | 28.máj.22 | 10.máj.22 | 518624 | 611976,3 | 13 | 1 | (+) | Delivery | 1 | 1 | Paul Heumann SA | Paul Heumann SA |
| 9 | RKA22-100-0001 | 2 | 3 | 02.jún.22 | 02.jún.22 | 274828 | 324297 | 18 | -1 | (-) | Transfer | - | - | - | |
| 10 | RKV22-100-0001 | 2 | 2 | 02.jún.22 | 02.jún.22 | 274828 | 324297 | 19 | 1 | (+) | Transfer | - | - | - | |
| 117 | PNY22-100-0053 | 2 | 2 | 04.aug.22 | 04.aug.22 | 23498,88 | 29540 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 111 | PNY22-100-0051 | 2 | 2 | 02.aug.22 | 02.aug.22 | 10291,63 | 12665 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 91 | PNY22-100-0035 | 2 | 2 | 13.júl.22 | 13.júl.22 | 12993,27 | 15916 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 79 | PNY22-100-0030 | 2 | 2 | 07.júl.22 | 07.júl.22 | 10206 | 12430 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 78 | PNY22-100-0029 | 2 | 2 | 06.júl.22 | 06.júl.22 | 10573,46 | 12977 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 68 | PNY22-100-0023 | 2 | 2 | 29.jún.22 | 29.jún.22 | 10678,54 | 13298 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 64 | PNY22-100-0020 | 2 | 2 | 25.jún.22 | 25.jún.22 | 2525,42 | 2980 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 44 | PNY22-100-0013 | 2 | 2 | 17.jún.22 | 17.jún.22 | 14208,73 | 17470 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 30 | PNY22-100-0007 | 2 | 2 | 10.jún.22 | 10.jún.22 | 22485,84 | 28098 | 7 | -1 | (-) | Cash Register | - | - | - | |
| 27 | PNY22-100-0006 | 2 | 2 | 09.jún.22 | 09.jún.22 | 23150,33 | 28408 | 7 | -1 | (-) | Cash Register | - | - | - |
- Akos074 years agoHelper I
DocumentHeaderId DocumentNumber Direction DirectionStr PartnerId StoreId WarehouseId ProductId ProductCode ProductName ProductTypeName ItemQuantityDir ItemNetPrice ItemGrossPrice ItemNetValuePromo ItemGrossValuePromo 117 PNY22-100-0053 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -2 1686,44 1990 3372,88 3980 10 RKV22-100-0001 1 (+) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal 20 1121 1322,78 22420 26455,6 9 RKA22-100-0001 -1 (-) 2 3 1 1 Heumann macesz dara (kóser) 400g Normal -20 1121 1322,78 22420 26455,6 2 BSZ22-PC-0001 1 (+) 1 2 3 1 1 Heumann macesz dara (kóser) 400g Normal 40 1121 1322,78 44840 52911,2 111 PNY22-100-0051 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 91 PNY22-100-0035 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 79 PNY22-100-0030 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 78 PNY22-100-0029 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 68 PNY22-100-0023 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 64 PNY22-100-0020 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 61 PNY22-100-0019 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 44 PNY22-100-0013 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 30 PNY22-100-0007 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990 27 PNY22-100-0006 -1 (-) 2 2 1 1 Heumann macesz dara (kóser) 400g Normal -1 1686,44 1990 1686,44 1990