Alteryx Designer Desktop Discussions

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

conditional statement or offset? Help please

coryanthony
8 - Asteroid

Hello,

 

Is there a way to omit offsetting rows? If [Business Area] & [Profit Center] is the same as debit and credit entry, i would like to filter off. 
CREDIT entry of -4,106.68 has the same [Business Area] & [Profit Center] as the DEBIT entry 4,106.68 ; therefore, i would like to filter it off.

 

Can this be done in Alteryx? Please help. Thank you

 

DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit Center
3,080.01USD3,080.01USD3,080.0101/01/202304202312/15/2022827218200007
-4,106.68USD-4,106.68USD-4,106.6801/15/202304202301/13/2023827218200007
4,106.68USD4,106.68USD4,106.6802/01/202305202301/13/2023827218200007
-5,133.35USD-5,133.35USD-5,133.3502/15/202305202302/15/2023827218200007
5,133.35USD5,133.35USD5,133.3503/01/202306202302/15/2023827218200007
-6,160.02USD-6,160.02USD-6,160.0203/15/202306202303/15/2023827218200007
-11,293.37USD-11,293.37USD-11,293.3708/15/202311202308/11/2023827218200007
 

 

24 REPLIES 24
AndrewDMerrill
13 - Pulsar

Here you are! Hopefully, this does everything you would need it to do. The file should be correct this time. If it works, please drop a like on this post!

coryanthony
8 - Asteroid

Hey @AndrewDMerrill 

 

I used my excel file with 53k plus entries and amazingly, it appears accurate. I am doing some validating now. I am quite lost on the batch Macro. Not quite sure whats its doing. Do i need to update this Macro?

 

Action i took - i replaced the sample input text tool with Input data Tool. I at least owe you a coffee :)

AndrewDMerrill
13 - Pulsar

That's great! You shouldn't need to update the Macro unless something changes about the underlying data, which would break everything anyway (I'm not sure what else you may be asking with regards to updating the macro).

 

Here's some a good article on Batch Macro's: https://knowledge.alteryx.com/index/s/article/Getting-Started-with-Batch-Macros-1583461640393

Here's a helpful video as well: https://www.youtube.com/watch?v=NNH_K5U5r78

 

Trying to explain as simply as possible: A batch macro allows you to perform certain actions on chunks of data instead of running the whole data in one pass. Imagine a pre-check and standard line through airport security (they both get you to your gate, but each line may have different policies and requirements like whether you need to take off your shoes).

 

In your case, we care less about doing different things for each batch, and more about "batching" the data to begin with. Essentially this case just uses the first half of what a batch macro can do, but that's all you need.

Each batch is comprised of all rows with the same DC Amount, Business Area, and Profit Center. From there, a filter divides the batch into credits and debits, which are each labeled with separate RecordID's and then Union'd back together (the trick is that we can now associate matching credits and debits based on this RecordID)

Example where batch has five records:

Debit RecordIDCredit RecordID
11
22
3 

^ Based on the table above we now have a way to know not to delete Debit RecordID = 3, since no corresponding Credit exists.

 

Hopefully this was not too confusing, but thorough enough for you to understand your workflow!

AndrewDMerrill
13 - Pulsar

Not to confuse, but I think this is a good learning point (it was for me)! I am also posting a separate solution that does not use a batch macro. Feel free to use whatever you are more comfortable with!

 

I had a nagging feeling that this could be done more simply, and I finally figured it out, so I wanted to share it with you @coryanthony.

 

This workflow uses 2 Multi-Row Formulas and output should be identical (I did minor testing on my end).

flying008
14 - Magnetar

Hi, @coryanthony 

 

Have you fully solved this problem yet? If need, please upload data table both input and output of your want.

Labels