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
7 - Meteor

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
flying008
14 - Magnetar

Hi, @coryanthony 

 

The Multi-Row Formula tool depend by position of row, so you need sort the location by date and other at first.

 

录制_2023_11_07_10_30_15_312.gif

coryanthony
7 - Meteor

okurr. There are levels to this and you're clearly on another level. 

 

Thank you so much. Much appreciated!

coryanthony
7 - Meteor

Hi @flying008 

 

one last question. Base on this workflow, what happens when the amounts are the same but does not offset? if both are credits or debits? Please see example below. 

 

we have 2 debit entries of 3080.01. Since both are debit, it should not offset/filter off. Please note, for all debits [posting code] = 40. For all credits [posting code] = 50. 

 

Input           
DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit CenterPosting Code
3080.01USD3080.01USD3080.011/1/20234202312/15/202282721820000740
-4106.68USD-4106.68USD-4106.681/15/2023420231/13/202382721820000750
4106.68USD4106.68USD4106.682/1/2023520231/13/202382721820000740
-5133.35USD-5133.35USD-5133.352/15/2023520232/15/202382721820000750
-5133.35USD-5133.35USD-5133.353/1/2023620232/15/202382721820000750
-11293.37USD-11293.4USD-11293.48/15/20231120238/11/202382721820000750
11293.37USD11293.37USD11293.378/15/20231120238/11/202382791820000840
3080.01USD3080.01USD3080.013/1/20234202312/15/202282721820000740
            
Output           
DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit CenterPosting Code
3080.01USD3080.01USD3080.011/1/20234202312/15/202282721820000740
-5133.35USD-5133.35USD-5133.352/15/2023520232/15/202382721820000750
-5133.35USD-5133.35USD-5133.353/1/2023620232/15/202382721820000750
-11293.37USD-11293.4USD-11293.48/15/20231120238/11/202382721820000750
11293.37USD11293.37USD11293.378/15/20231120238/11/202382791820000840
3080.01USD3080.01USD3080.013/1/20234202312/15/202282721820000740

 

 

 

coryanthony
7 - Meteor

This workflow does not appears accurate ☹️. Data below is being filtered off but should not. These entries do not offset since theyre all credits. 

 

DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit CenterPosting Key
-318.68USD-318.68USD-318.6805/01/202308202305/01/2023821G1820005050
-318.68USD-318.68USD-318.6806/01/202309202306/01/2023821G1820005050
-318.68USD-318.68USD-318.6807/01/202310202307/01/2023821G1820005050
-318.68USD-318.68USD-318.6808/01/202311202308/01/2023821G1820005050
-384.86USD-384.86USD-384.8601/01/202304202301/01/2023821G1820005050
-384.86USD-384.86USD-384.8602/01/202305202302/01/2023821G1820005050
-384.86USD-384.86USD-384.8603/01/202306202303/01/2023821G1820005050
-384.86USD-384.86USD-384.8604/01/202307202304/01/2023821G1820005050
AndrewDMerrill
13 - Pulsar

It will not work as intended if multiple debits and credits are the same, but not offsetting. The provided workflow will just delete everything that matches Business Area and Profit Center with duplicate absolute value.

coryanthony
7 - Meteor

Hi @AndrewDMerrill  - Thank you again. Because i am not an expert (Far from it), i have a silly question. Can we possible add to the multi-formula? 

 

ADDING - IF [Posting Code] != [Posting Code] 

 

IIF(ABS([DC Amount]) = ABS([Row-1:DC Amount]) && [Posting Code] != [Row-1:[Posting Code] || 

Current expression is - IIF(ABS([DC Amount]) = ABS([Row-1:DC Amount]) || ABS([DC Amount]) = ABS([Row+1:DC Amount]), 0, 1)

 

Posting codes for Debits = 40

Posting codes for Credits = 50

AndrewDMerrill
13 - Pulsar

That could help partially, but you still have another problem (even with that excellent idea). Image you have the following table:

DC AmountPosting Code
500040
500040
-500050
-500050

 

My assumption is that you would want all four rows deleted, but because we only check one row behind or ahead, only the middle two rows would be deleted. I hope this makes sense.

 

Based on the number of requirements that you have, I'm thinking that a batch macro would be the best bet for you.

coryanthony
7 - Meteor

@AndrewDMerrill 

 

what an excellent point, solid. Thank you for you time and help. seriously appreciate it. 

 

I guess i have to figure out batch marco now. But it is possible right? 

AndrewDMerrill
13 - Pulsar

I'm trying to build one for you now, but before I finish it, will DC Amount ever be null?

coryanthony
7 - Meteor

@AndrewDMerrill 

 

 DC Amount should never be null :)

Labels