The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

I am trying to create a for loop (Batch Macro)

christopherKiener12
7 - Meteor

for each File ID take the first 160 records where the risk numeric is the highest and where flag = 1. I assume this would be a macro solution just cant figure it out. Here is a sc of the fields. 

 

christopherKiener12_0-1683749367028.png

Also attaching some data  

4 REPLIES 4
binu_acs
21 - Polaris

@christopherKiener12 Do you have the expected result?

christopherKiener12
7 - Meteor

The expected result would be 160 records for each file ID. where risk number is highest and where flag = 1.   I think there are 12 file ID (1-12) so 160X12 = 1920 records as the output 

christopherKiener12
7 - Meteor

Another way to put it would be 1920 ID's ranked based on the loop criteria provided 

binu_acs
21 - Polaris

@christopherKiener12 Attaching the workflow, I had to create two batch macros for your use case, let me know it works for you

 

binuacs_0-1683751634242.png

 

Labels
Top Solution Authors