Alteryx designer Discussions

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

Multi-armed Bandit Problem in Alteryx

Hi Alteryx!

Is anyone familiar with the Multi-armed Bandit problem (see:

Looking at the code, it seems that the use of iterative macro is necessary. Anyone has an idea how to proceed with this, like a sample workflow?

Thanks all.

- Tiff
ACE Emeritus
ACE Emeritus

Hi @a150138 


You're right that some sort of iterative macro would probably be needed, however before doing that, since the Python code is literally right there ready to cut and paste, I would consider using the Python tool, or perhaps the R if that works better for you. I've attached a workflow that duplicates their example in Alteryx with both R and Python.



  • I did rearrange things a little
  • I output only the "total reward" figures that are calculated
  • I commented out anything that wasn't contributing to that calculation
  • Python's "" didn't play nice with my laptop's crazy security, so I read the physical file from within the Python, rather than grabbing input #1... you can comment out the physical file read and comment back in the and it should work for you.


Hope that helps!



Hi John,


Very useful and thanks for the guidance! I will explore the R & Python code inside and see whether I can take it a step further by converting it into a macro (Still learning).