Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello together,
i am looking for a solution to the following problem.
I have a table which i load via skript:
OrderId | ArtikelNR | OrderItemQuantity |
3811 | 8000100 | 1 |
3811 | 2354003 | 2 |
3811 | 2354011 | 4 |
3811 | 2354009 | 1 |
3811 | 2354014 | 2 |
3811 | 2354474 | 2 |
3811 | 2354010 | 2 |
3811 | 2354000 | 2 |
3811 | 2354012 | 4 |
3812 | 6221750 | 10 |
3812 | 8000100 | 1 |
3815 | 8000100 | 1 |
3815 | 1231986 | 5 |
Now i need to add an Order Position (Field OrderPos) through the skript LOAD statement depending on the OrderID, always counting up by 1 starting from 1.
This should be the result:
OrderId | OrderPos | ArtikelNR | OrderItemQuantity |
3811 | 1 | 8000100 | 1 |
3811 | 2 | 2354003 | 2 |
3811 | 3 | 2354011 | 4 |
3811 | 4 | 2354009 | 1 |
3811 | 5 | 2354014 | 2 |
3811 | 6 | 2354474 | 2 |
3811 | 7 | 2354010 | 2 |
3811 | 8 | 2354000 | 2 |
3811 | 9 | 2354012 | 4 |
3812 | 1 | 6221750 | 10 |
3812 | 2 | 8000100 | 1 |
3815 | 1 | 8000100 | 1 |
3815 | 2 | 1231986 | 5 |
It sounds simple, but sadly i cannot come up with a solution myself.
Perhaps this?
Load OrderID, AutoNumber(Rowno(), OrderID) as OrderPos, ArtikelINR, OrderItemQuanity From Source;
Perhaps this?
Load OrderID, AutoNumber(Rowno(), OrderID) as OrderPos, ArtikelINR, OrderItemQuanity From Source;
Hello Anil_Babu_Samineni,
that worked perfectly. Thanks you very much for your help!
Best wishes from Germany,
Hermann