Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Batch macro input - exclude all rows after a row with specific text

catcat1720
5 - Atom

Hi, I have a batch macro that is pulling in multiple files. Each file has a row at the end of the data, saying "DO NOT DELETE" in column A. There are various teams submitting these files, and they often put additional workings after this row, in various columns. Ideally, I'd like the batch macro to bring in only the rows above this "DO NOT DELETE" row. How can I do this? Thank you!

3 REPLIES 3
rzdodson
12 - Quasar

@catcat1720 not sure how your batch macro that brings in all of the files is structured. But, I am wagering you have an Input tool that is getting updated by Control Parameter and Action tools to functionally pass in each file one-by-one. And, I am thinking you may be using a Directory tool in the original workflow to retrieve the list of file names you are wanting to pass through your batch macro.

 

If that is the case, I would drop a RecordID tool right afterwards. From here, you can insert a Filter tool that retrieves the data prior to that "DO NOT DELETE" value. Once the macro is saved and you run the workflow, it'll only retrieve the data that is relevant for your analysis.

Solution.png

 

catcat1720
5 - Atom

Thank you, will give it a go and report back!

Gaurav_Dhama_
9 - Comet

Assuming since it is a manual workpaper, the row where Do not delete appears is not fixed.

 

To take care of that dynamically, in addition to @rzdodson flow, filter for string Do no delete after adding record ID. You will get a record ID where this string appears, append this value to original data, lets call this appended column as LstRw. Use a filter tool to compare the record ID with the LstRw ([RecordID]<[LstRw]). This will give you all the data above this string

 

Labels
Top Solution Authors