An Iterative Macro to Calculate the Permutations
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Dear All
I would like to ask your help on the iterative macro to calculate the permulations of given numbers.
For example, If I input 3, I would like to result to be as below
P | P1 | P2 | P3 |
3 | 1 | 2 | 3 |
3 | 1 | 3 | 2 |
3 | 2 | 1 | 3 |
3 | 2 | 3 | 1 |
3 | 3 | 1 | 2 |
3 | 3 | 2 | 1 |
I watch the interactive lesson for iterative macro again and still get stuck.
Hope you can enlighten me. Thans a lot.
Solved! Go to Solution.
- Labels:
- Help
- Iterative Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Qiu
I think there is 3 problem.
First problem is the wrong select of the field.
Second problem is the exit loop condition. The original macro is after the appending. The result contains wrong data which should be disposed.
Third problem is that you input the field "Field1" which should not be contain. Please insert select tool and delete the Field1.
I attached the fixed version and my workflow which I made from scratch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AkimasaKajitani
Thank you so much for saving my day.
I shoud be more careful.
I am planning to have a weekly challenge idea which involves an iterative macro. Maybe I can include your name for the submission? 😁
ありがとうございます!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Qiu
You are welcome!
Debugging the Iterative macro is difficult. When you debug the Iterative macro, I recommend adding the macro output tool after the macro input tool with the formula tool to which you add the [Engine.IterationNumber].