We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Iterative Macro: N items in a combination

Seffana_
7 - Meteor

Hello,

 

Can someone help me with an iterative macro question?

 

To avoid manually adding extra append tools each time I want to up the number of items I want in a combination, I'm trying to build an iterative macro that would dynamically output all possible combinations of items for N items in a combination.

 

My macro currently gives me the below error:

Error: Product Combination Macro (HELP) (108): The input "Iteration Input" does not have a connection

1.PNG

 

The image above shows my workflow looking at all the possible combinations of products for 2, 3, or 4 items in a combination, and me testing out my failed macro. For sense checking, I use this website to see if I'm outputting the right numbers - I use the below configuration.

 

2.PNG

I'm not all that good macros and not sure how to solve this error. Has anyone had this issue before?

 

Many thanks in advance!

 

Seffana

3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@Seffana_ 
I was not really able to follow your flow.
anyway, I have modified the flow to be able to calcaute the combinations based on user Text input.

Test based on the site your provided for a few cases and it should work.

0116-Seffana_.PNG0116-Seffana_B.PNG

Seffana_
7 - Meteor

Hi @Qiu, thanks for helping.

 

Your workflow does output the number of records expected for X products with N items in each combination. However, the items in your combination include the [NumberChosen] field in the combination, which I don't want to include in the concatenation.

 

Regarding your point on my flow, I used this solution from Philip Mannering to guide me on how to build combinations from a list of items.

 

Seffana__0-1642331658747.png

 

I'd like to reproduce this inside a macro and have the flexibility to choose how many items (N) I want in a combination. The thing I'm most curious about is learning is how to solve the error message my macro is throwing at me.

 

Error: Product Combination Macro (HELP) (108): The input "Iteration Input" does not have a connection

 

Does anyone have any ideas?

 

Qiu
21 - Polaris
21 - Polaris

@Seffana_ 
Thank you for the feedback. It seems I overtook it.
Anyway, for the error itself, you are missing one more input for the Macro.
But honestly, I did not quite get the logic in your macro, that is why, I remade it.

I can also see you use Rename in a few locations, we should minimize it in an iterative macro.

Qiu_0-1642373953541.png

 

Labels
Top Solution Authors