Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter the data based on one Record ID after another till there are no RecordIDs

Manjari_T
6 - Meteoroid

Hi All, 

 

I have a macro (1st Macro) that picks txt files on one by one and extracts a value from the file until there are no more files, this is working currently

 

however, inside the 1st macro I need another macro (2nd Macro) that will filter the Record ID one by one until there are no more recordIDs. I tried various macros from different posts however not getting to work for my dataset. Requesting help.

 

I have provided sample data of the dataset for the 2nd macro

 

RecordIDColumn1Column2
1ChocoA
1IcecreamB
1CakeC
2ChocoD
2IcecreamE
2CakeF
3ChocoP
3IcecreamQ
3CakeR
4ChocoL
4IcecreamM
4CakeN
6 REPLIES 6
KGT
13 - Pulsar

I'm not sure what you are after. In order to filter the dataset, you could just use a filter, and if everything in that iteration of the macro has to go through the filter, then don;t filter at all, and rather just do the operation against the table with a Join. What output are you expecting?

Manjari_T
6 - Meteoroid

Hi @KGT, 

Thank you for you response. I need the output to look like this:

 

for the 1st Iteration when RecordID = 1 then I would like the macro to filter for RecordID 1 rows

RecordIDColumn1Column2
1ChocoA
1IcecreamB
1CakeC

 

For 2nd iteration the RecordID = 2 then the output is 

RecordIDColumn1Column2
2ChocoD
2IcecreamE
2CakeF

Similarly for all RecordIDs. Please see the attached macro which I am working on I am not sure where I am going wrong 

caltang
17 - Castor
17 - Castor

My attachment doesn't solve your need but it does fix your macro...

 

Actually I don't know what you're trying to do. 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
KGT
13 - Pulsar

@caltang has fixed your macro, the control parameter was connected to the wrong side of the macro. It needs to connect to the upside down question mark.

 

Your filter within the filtering macro is only working because you are replacing the number including the quotes. Not sure why you are converting to string first if your control parameter is numeric.

 

In general Macros within Macros are fine, however you need to remember that it creates an extra dependency, hence I only do it if it's necessary. That's the reason I was asking about the output, and what you are trying to achieve.

 

Not many people these days know about the "supporting_macros" and "supporting_templates" directory structure and so dependencies are up to the user. Of note, if you use those directories, the contents will not show up in the parent Macro Repository.

Gaurav_Dhama_
12 - Quasar

Regarding the packaging the subMacros, refer the comment section of this blog post.

PDF Packaging in Alteryx Designer - Alteryx Community

 

Manjari_T
6 - Meteoroid

Thank you @Caltang this really helped.

Labels
Top Solution Authors