Want to different rows in differet iteration

Himanshu_Pant
Himanshu_Pant New Altair Community Member
edited November 2024 in Community Q&A
Lets say I have a dataset containing 10 rows. I want do iteration over these rows. In first iteration I want first row as output, in the second iteration I want first two rows as output, in third iteration first three rows and so on. How can i achieve this.
Tagged:

Best Answer

  • MartinLiebig
    MartinLiebig
    Altair Employee
    edited June 2021 Answer ✓
    Hi,
    i strongly advice to use proper set operations to do the transformation. Especially if your data set is not 10, but 10000 rows+.

    But you can use Generate ID, then Group Into Collection with this id and then Loop Collection to iterate over each row. A simple Loop examples with a Filter Example Range inside would also do it, but is slower than the Group Collection approac.


    Best,
    Martin

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    edited June 2021 Answer ✓
    Hi,
    i strongly advice to use proper set operations to do the transformation. Especially if your data set is not 10, but 10000 rows+.

    But you can use Generate ID, then Group Into Collection with this id and then Loop Collection to iterate over each row. A simple Loop examples with a Filter Example Range inside would also do it, but is slower than the Group Collection approac.


    Best,
    Martin