We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Batch Macro for Data Cleansing

kathleenanne
5 - Atom

I need to create separate outputs per ID. But before I do that, I need to remove all the columns with null values, which is different for each row. A colleague shared a batch macro to use for the data cleansing, but it's not working and I'm not sure how to fix it.

 

Current:

ProductIDTimestamp1Prev IdentifierMarketVenue
A123456Null-1101Null
B2345672021-07-07NullABCDNull
B2345672021-07-07NullABCDNull

 

Desired:

Output 1

ProductIDPrev IdentifierMarket
A123456-1101

 

Output 2

ProductIDTimestamp1Market
B2345672021-07-07ABCD
B2345672021-07-07ABCD
8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @kathleenanne 

 

The issue is changing column hence they cannot be grouped under single table.

 

Is the output 1 and output 2 are written to an output file seperatley. How is the output used?

kathleenanne
5 - Atom

Yes Output 1 and 2 need to be on separate files. And that is the end of the process.

atcodedog05
22 - Nova
22 - Nova

Hi @kathleenanne 

 

Thank you for the clarification.

 

Workflow:

atcodedog05_0-1628489798313.png

 

Macro:

atcodedog05_1-1628489832551.png

 

Here i am writing each IDs to its own sheet. Please check the output file data cleanse.xlsx.

 

Hope this helps : )

kathleenanne
5 - Atom

Thanks for this.

 

I looked at the macro, and saw you used a filter tool for the IDs. I'm sorry I should have clarified that there can be instances when there are more than 2 IDs. Will the macro still work in that case?

atcodedog05
22 - Nova
22 - Nova

Hi @kathleenanne 

 

The filter value will be dynamically changed on each batch iteration. And it should support multiple Ids.

atcodedog05
22 - Nova
22 - Nova

Hi @kathleenanne 

 

Here is an example with 3 ids. Refer the highlighted output log.

 

Workflow:

atcodedog05_0-1628497455060.png

 

Hope this helps : )

 

kathleenanne
5 - Atom

Thanks so much @atcodedog05! The iterations worked for multiple IDs 🙂

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @kathleenanne 

Cheers and have a nice day!

Labels
Top Solution Authors