This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a dataset that looks like(these numbers and columns are random)
this should be 77
Now , I am calculating column F & G using certain conditions from the prior columns, once I have calculated values for all the columns for a particuar period, I procced to the next period where value for column E equals that of column G in previous period.
And, then again I calculate the values of F & G for period 2 . I want to repaeat this process for multiple periods.
I believe batch macro is the solution but I am unable to find a way to use it in this case, any approach without using a macro would also be helpful
Just for clarification, what is the starting state? No column F and G, as they are derived by your workflow? But what about column E? For period 1, it sounds like E is already there? But not there for period 2?
Anyway - a starting state along with the desired end state will help us determine various solutions.
This is basically row-dependent iteration, which is tricky. Here's a nice write-up and various iteration tools in R: http://nicercode.github.io/guides/repeating-things/, and even in R, where myriad "apply" functions can do almost anything you can imagine, they admit that a regular "For" loop works great for row-dependent iteration, "where the output of one iteration depends on the result of the previous iteration."
In that light I went ahead and created a simple call to R that performs a For loop to fill out the input data set. I've attached the workflow. Hopefully this is easily modified to fit your specific needs.
(With all that said - I'd also be very interested in someone showing a solution using only Alteryx tools.)