Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Generate next value based on the previous value

Hello everyone,

I have the following issue if anyone can help with it, please.

i have a list of PCK numbers: as shown in table below. I want to generate something similar to the table below. My only issue is the first column. Suppose that i have the first number, how do i use the previous rows number and add 10 to it to make the next number. So, for example, my first number is 40 and for the first row i use 40+10=50. For the next iteration, i want to use 50+10=60 and so on. It is like iterative calculation using the value i pass in.

the number 40 is taken from another table. It is the max "Sort Number" in another table. so I use Peek() to obtain the max number from that table. Now i want to generate a separate table with the PCK list i have.

 

Please let me know if you are unsure of what i am trying to ask.

 

SortNumberPNIndicatorPCKGCK
50**R444*
60**T3233*
70**Y351*
80**R2331*

 

 

Thank you.

Labels (2)
10 Replies
waleeed_mahmood
Creator
Creator
Author

Hello Andoryuu:

I will apply your code to my script and let you know. So far, it looks promising. 🙂