Generate a sequence iteration wise

sgnarkhede2016
sgnarkhede2016 New Altair Community Member
edited November 2024 in Community Q&A
Hello,
I want to generate a sequence like.

In my first loop, Five customers is coming then I will generate Id 1 to 5
In the next loop 7 Customer is coming I want to start Id from 6 and so as per iteration.

Tagged:

Best Answer

  • Marco_Barradas
    Marco_Barradas
    Altair Employee
    Answer ✓
    @sgnarkhede2016 you'll need to Use Loop Batches, Generate ID, Extract Macro operator to do what you are trying to achieve.

    You'll extract the Max ID that was created with the extract Macro and then Use it as a parameter for the offset in the Generate ID.
     

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee
    Hi,
    have you checked the operator Generate ID?

    Best,
    Martin
  • Marco_Barradas
    Marco_Barradas
    Altair Employee
    Answer ✓
    @sgnarkhede2016 you'll need to Use Loop Batches, Generate ID, Extract Macro operator to do what you are trying to achieve.

    You'll extract the Max ID that was created with the extract Macro and then Use it as a parameter for the offset in the Generate ID.
     
  • sgnarkhede2016
    sgnarkhede2016 New Altair Community Member
    edited March 2020
    But first time i need to pass offset value is like 1 or 101 next time i will get Max_Id in macro max but how to pass  that max macro  in generate Id for next iteration
    e.g I have used branch, give condition if iteration==1 then I pass in offset =0  and store max  id in Max_Id macro and In Else part I have mentioned in Generate Id Offset %{Max_Id}