Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Creating a new column to tag related records

vham
5 - Atom

I previously had a solution for this in Excel/VBA, but in trying to recreate my work in Alteryx I have been unable to replicate a certain feature.

 

I am working with a ledger of transactions and for those unfamiliar, there are some transactions known as accruals. Accruals in this situation are expenses that have occured, but have not yet been recorded on the ledger. Anyway, accruals reverse automatically on the first day of every month in the form of an offsetting record. Our ledger does not identify Accruals or their reversals in the database so logic must be built in order to idenify them. Here is a simplified sample of our ledger.

Trans No.Posting DateAcct UnitDescriptionAmountAutoRev
19/15/20181234Tuition Reimbursement15000Y
29/17/20185678Desk Lamps4000N
39/20/20181234Catering Services2350N
49/20/20181234Training Class1500N
59/27/20185678Employee Rewards800Y
69/28/20181234Employee Rewards400N
710/1/20181234Tuition Reimbursement-15000N
810/1/20181234Chairs Refund-800N
910/1/20185678Employee Rewards-800N

 

The accruals themselves are easy to identify. The AutoRev column means auto-reverse and any time an accrual is made, it is flagged with a "Y" in that column. The reversal is trickier to identify. You need to search the next month for a record with matching values and an inverse transaction amount. In the above table, Transaction 1's reversal is Transaction 7 and Transaction 5's is Transaction 9. I want to create something that can tag these accruals and reversals with the end result looking something like this:

Trans No.Posting DateAcct UnitDescriptionAmountAutoRevAccrual/Reversal
19/15/20181234Tuition Reimbursement15000YAccrual
29/17/20185678Desk Lamps4000N 
39/20/20181234Catering Services2350N 
49/20/20181234Training Class1500N 
59/27/20185678Employee Rewards800YAccrual
69/28/20181234Employee Rewards400N 
710/1/20181234Tuition Reimbursement-15000NReversal
810/1/20181234Chairs Refund-800N 
910/1/20185678Employee Rewards-800NReversal

 

I have been looking online for solutions, but I couldn't find anything that was related.

 

The macro I created in excel looped through all of the records and if it found a records with AutoRev = "Y" then it looped through all of the records again to find a record that had matching values in all of the columns and an inverse value in the amount column, and it would tag the original record as "Accrual" and the found matching record as "Reversal". Any ideas as to how to tackle this would be much appreciated! (Very new to Alteryx fyi)

5 REPLIES 5
BenMoss
ACE Emeritus
ACE Emeritus

Although this seems like a complex problem there is a relatively straight forward solution.

 

You can solve your problem with a filter, join and union (plus a few more steps!)

 

I've built out your solutions, take a look, and if you want me to explain any steps then let me know!

 

Ben

DavidP
17 - Castor
17 - Castor

Here's how I would do it.

 

accrual reversal.png

DavidP
17 - Castor
17 - Castor

Sorry Ben, didn't realise you posted a solution already.

vham
5 - Atom

Thanks for the quick reply, your solution helped as well!

vham
5 - Atom

Thank you so much, that helped me out tremendously!

Labels