Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If I have a table like this:
ID AMOUNT
160 200
160 300
120 100
130 340
160 140
130 350
How can I calculate a progressive number for any kind of IDs ?!?!
I need a table like this:
ID AMOUNT PROGR
160 200 1
160 300 2
120 100 1
130 340 1
160 140 3
130 350 2
and so on......
Anyone can give a solution please?
May you can find useful this small exmaple og accumulation by aggregation
May you can find useful this small exmaple og accumulation by aggregation
Hi Radeon,
One way is to sort the initial table on ID and some other field that specifies the order, Date, LineNo or similar. Then you can use peek on every row and see if the previous ID is the same as the ID on the current row and if it is, you peek at the PROGR value from the previous row and add 1 to it. If the ID is different, you set PROGR to 1 for that row.
There should be some examples on Peek here in the forums, and I also recommend checking it out in the F1 help and the ref manual.
//JSN