Hi guys, i have a dataset as below, with the desired output (named: “init rate”) at the last column:
ID
Date_order
Production_weight
Production_rate
Stock_Available
Desired_output
A
0
100000
4.2
0
4.20
A
1
30000
4.5
100000
4.27
A
2
26000
4.4
130000
4.29
A
3
30000
4.5
132000
4.33
A
4
26000
4.4
138000
4.34
“Init rate” will be the name of the desired output column
The logic is, which will apply for each ID (many IDs will be in the dataset, I use only one for example):
If the date order is 0, then the “init rate” is equal to the “production rate”
@4nak1n well there is a complication to this and I solved it by using a somewhat over engineered workflow but it does work. Maybe there is a better way to do it. I iterate over the table and always work with a current row and the last one and then send the result back and do the next calculation.