Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Create a sequence out of a Matrix

fcobosmolina
6 - Meteoroid

Hello community!

 

I am a beginner in Alteryx Designer and I can't figure out how to do something, so I thought the community might have an answer for that.

 

I am trying to extract a sequence for producing products out of a matrix created with the results from the optimization tool. It's a matrix N*N of different products and there are the same products in columns and rows as you can see in the following picture. 

 

2021-02-22_20-12-57.png

 

The sequence always start with the product which has all zeros in the column (in this case D), then we would go to the row D and the next product would be the one which has a 1 in the row (in this case F) and it continues like this successively. It always finishes with the product which has all zeros in the row (in this case B). Therefore, in this case the whole sequence of the 6 products is D-F-C-E-A-B.

 

I have thought about creating a workflow which finds the sequence with an iterative macro but I can' figure out how to create it. 

 

Happy to hear any ideas you have 🙂

Thank you. 

 

 

 

Best, 

Fran

2 REPLIES 2
jrgo
14 - Magnetar

@fcobosmolina 

 

I believe an iterative macro is definitely what would be required. I attached a packaged workflow that contains the workflow and the macro. Before the data hits the macro, I first re-structure the data and identify the first product in the sequence. The macro then iterates through the remaining and the output produces the sequence key, as you can see pictured below which matches what you mentioned originally.

 

jrgo_0-1614027657725.png

 

I'm not sure how this macro will work using real data as I assume the example you illustrated is generalized. As such, the macro may not work as is when you plug in real data, but this should at least give you a starting point to start developing with.

 

If you're not familiar with creating iterative macros, I do suggest looking through the training content around this topic that's available in Community.

 

Hope this helps!

Jimmy
Teknion Data Solutions

 

fcobosmolina
6 - Meteoroid

 

Hey this was really cool! That was exactly what I needed, I will have to adjust some parameters for the different final cases but It's great. I am still learning all the tools the designer has and that was really helpful.

 

Thanks a lot for your fast answer! 

Labels