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 find the concept of Batch and/or Iterative macros, when done specifically for the simple purpose of iteration, to be a fair bit of overhead. If we could extract the fundamental qualities of a loop and get that into an "Iteration Tool," it could become a well-used tool from the pallette.
Assume that the iteration is over the rows of a given input data set.
For the "body of the loop" allow multiple expressions, each of which iteratively assigns the i'th position of a given variable (which could be either existing or derived just like the Formula tool and it's expression).
Allow referencing of the loop index variable from within expressions
If the input data set from that example were sent into the proposed Iteration Tool... it would automatically loop over the dataset rows; and three expressions could be supplied in the Tool configuration to solve the problem:
VarE: IF [i] > 1 THEN VarF[i-1] + VarG[i-1] ELSE VarE ENDIF
VarF: VarA + VarB
VarG: VarC + VarD
For implementation purposes, this would be logically equivalent to:
VarE[i]: IF [i] > 1 THEN VarF[i-1] + VarG[i-1] ELSE VarE[i] ENDIF
VarF[i]: VarA[i] + VarB[i]
VarG[i]: VarC[i] + VarD[i]
(so, basically, the i'th row is assumed unless otherwise provided in the expression syntax).
I hope this isn't too outlandish - I've tried to think through how this could be accomplished (1) as a tool that is not too fiendishly difficult for Alteryx to implement and (2) which would also be easy for us, the end users, to utilize. Thanks!