Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

I'm studying how to make an iterative macro, can I use that to sort/reorder this data?

salvador_ian
7 - Meteor

Hello Community,

 

I have this set of data:

 

Data Set A - Possible Start/End Points

 

RecordIDPairing RecordIDTYPE
996TEE BRANCH
2010END-POSITION-NULL
1820END-POSITION-NULL
2226END-CONNECTION-EQUIPMENT

 

Data Set B- Various connected Type(s)

 

RecordIDPairing RecordIDTYPE
251ELBOW
551PIPE
552PIPE
992TEE
253ELBOW
1913PIPE
994TEE
1294PIPE
1295PIPE
1615ELBOW
996TEE BRANCH
2676PIPE
1617ELBOW
2357PIPE
2358PIPE
2998ELBOW
2679PIPE
3299ELBOW
2010END-POSITION-NULL
67010PIPE
34611PIPE
37311ELBOW
34612PIPE
40312FLANGE
38913GASKET
40313FLANGE
38914GASKET
43014TRAP
29915ELBOW
52615PIPE
43016TRAP
45716GASKET
45717GASKET
47117VALVE
47118VALVE
51218GASKET
37319ELBOW
61119PIPE
1820END-POSITION-NULL
98020PIPE
51221GASKET
57021FLANGE
52622PIPE
57022FLANGE
32923ELBOW
83623PIPE
19124PIPE
102024ELBOW
61125PIPE
65425ELBOW
2226END-CONNECTION-EQUIPMENT
129526GASKET
65427ELBOW
67027PIPE
69728PIPE
72428ELBOW
69729PIPE
75429FLANGE
74030GASKET
75430FLANGE
74031GASKET
78131VALVE
78132VALVE
82232GASKET
72433ELBOW
92133PIPE
82234GASKET
88034FLANGE
83635PIPE
88035FLANGE
92136PIPE
96436ELBOW
96437ELBOW
98037PIPE
102038ELBOW
105038PIPE
105039PIPE
107839ELBOW
107840ELBOW
110840PIPE
110841PIPE
116841ELBOW
116842ELBOW
122042PIPE
122043PIPE
126843FLANGE
126844FLANGE
129544GASKET

 

The goal is to organize each record in this way:

 

1st Step. Get any record from Data Set A (Data Set A is only for starting the process).

2nd Step. Make the 2nd record (from Data Set B) to have the same [Pairing RecordID] but different [Type] as the previous record

3rd Step. Make the 3rd record (from Data Set B) to have the same [RecordID] as the previous record

4th Step. Make the 4th record (from Data Set B) to have the same [Pairing RecordID] but different [Type] as the previous record

5th Step. Make the 5th record (from Data Set B) to have the same [RecordID] as the previous record

...

..

.(repeat until nth time)

nth Step.  If there is no matching record in Data Set B, end the loop, and remove the 1st record and (n-1)th record from Data Set A.

(n+1)th Step. Start similar process as 1st step, get record from Data Set A (without the already used values) and start the process again until all the values in Data Set A is used.

 

I'm fairly new to Alteryx so I'm having difficulty in choosing which set of tools needed for 2nd step and 3rd step, that would allow me make the next row have the same value as the previous row with this given data. 

Additionally, I'm currently practicing making an iterative macro but I'm not sure if the conditions I made on nth step and n+1 step would be applicable or I'll need to make a different kind of condition.

 

Any advice is greatly appreciated.

I'm looking forward to your responses.

Thank you very much!

 

Best Regards,

Ian

 

0 REPLIES 0
Labels