Alteryx Designer Desktop Discussions

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

Finding records that breaks net zero total

byung0917
7 - Meteor

Dear all. 

I need help!!

 

I need to find members in a group that make net zero. 

To simplify, here is an example. 

 

Every records are supposed to be netted out here. 

Fors example, Record B is paired with Record E to be zero in net. 

If a record is reversed, it should be always reversed with one record. 

For example, 100 will be netted out with -100. Never with two records of -50s. 

 

Group IDTransaction IDAmount
1Record A500
1Record B400
1Record C-200
1Record D200
1Record E-400
2Record F150
2Record G120
2Record H-150
2Record I-120
3Record J50
3Record K20
3Record M-20
3Record N30

 

So, from the sample data above, records below have to be carved out, so I can let people know these records have not been netted out. 

 

Expected output

Group IDTransaction IDAmount
1Record A500
3Record N30
3Record J50

 

I don't want to join with amount columns since there may be two records with same amounts. 

 

Do you experts have some good idea how to handle this?

 

 

Thank you so much Awesome Experts!

 

 

 

5 REPLIES 5
DataNath
17 - Castor

Hey @byung0917, how does this look? I added an extra 500 and -500 to test if the logic works with multiple of the same values, hence why the initial screenshot appears like I haven't gotten the desired outcome. Have attached the workflow for you to test yourself!

 

DataNath_1-1652829525305.png

 

 

Let me know if not - happy to take another look. Interesting issue!

 

grazitti_sapna
17 - Castor

@byung0917, is not a great solution but it will work for your sample dataset.

 

grazitti_sapna_0-1652854380449.png

 

Thanks!

Sapna Gupta
byung0917
7 - Meteor

Thank you so much for sharing this!

byung0917
7 - Meteor

Thank you so much. It worked pretty well!!

grazitti_sapna
17 - Castor

@byung0917, Happy to help 🙂

Sapna Gupta
Labels