Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Delete or exclude rows from a batch macro output

Meena
8 - Asteroid

Hi,

 

I have output from a batch macro which populates results based on certain business rules.

Since the same name, value can pass 1 business rule and fail another - The macro result output will have more than 1 result for each record, name combination based on the number of business rules being processed by the macro.

 

I've attached the expected output from the macro.

The rows highlighted in yellow should be excluded or deleted based on a Record ID, Name combination.

That is for a record ID, Name combination if there are more than 1 row then the row with 'Valid' in result should be deleted before proceeding to the next step in workflow.

However if there are more than 1 rows with 'Valid' for a record Id, name then 1 of it should be included (like Record Id 3, Merchant Name).

 

Please suggest how this can be done.

 

Thanks

4 REPLIES 4
ganesamurthy
8 - Asteroid
1. Use filter on all '-1' records that needs to be valid output.
2. Use Join tool and join true and false part of previous filter on recordID and name field
3. If your false records are input for right join then take right outer join result with the true records of filter from step-1 above into a union tool.
4. Then sort it with ID and Name field.
danilang
19 - Altair
19 - Altair

Hi @Meena 

 

This should provide you with what you're looking for

w.png

 

The filter split the records based on OutputResult.  The false records get a unique applied to remove all the duplicate "Is Valid" rows.  This rest are joined to the True records from the filter, but here the join is used to exclude and rows/names that are covered by the top True path so we take R output of the Join.  Union these with -1 records, sort by record ID and you're left with

 

 r.png  

 

Dan

Meena
8 - Asteroid

Hi Dan

 

Can you please include your solution worklflow only instead of package?

Due to version difference couldn't open the yzxp.

 

Thanks

danilang
19 - Altair
19 - Altair

Hi @Meena 

 

Here's the workflow, but remember the tip about editing the xml.

 

Dan

 

 

 

Labels
Top Solution Authors