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
rzdodson
12 - Quasar

@coryanthony here is one way to do this.

Solution.png

coryanthony
7 - Meteor

Hi rzdodson,

 

Thank you for your time and response. I am trying to follow your steps and make sense of it. It appears i still have unwanted data. I should end up with 3 different entries but you currently have 5 entries. The below should be filter off since they offset(creating a new tab/sheet with these if possible). 

 

-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

 

 

The remaining entries should be below. 

 

DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit Center
3,080.01USD3,080.01USD3,080.0101/01/202304202312/15/2022827218200007
-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
rzdodson
12 - Quasar

@coryanthony apologies. I had thought you had wanted to just remove the offset row.

 

If I understand the above now, this should help you out. I also went ahead and collapsed the various tools in a macro for you. 

 

Solution1.png

 

Hope this helps! :)

coryanthony
7 - Meteor

you are amazing. one issue I came across. It should only offset if the [Business Area] or and [Profit Center] is this same. Please see records below. The amount appears to be related but the [Business Area] / [Profit Center] is different. Therefore, records should be displayed since theyre not offsetting/related. 

 

DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit Center
-11,293.37USD-11,293.37USD-11,293.3708/15/202311202308/11/2023827218200007
11,293.37USD11,293.37USD11,293.3708/15/202311202308/11/2023827918200078

 

AndrewDMerrill
13 - Pulsar

Will the offsets always neighbor each other? If yes, I have modified rzdodson's code to accomplish what you requested.

coryanthony
7 - Meteor

Hi Andrew, 

 

Thank you for joining and the solid question.

 

 It would not always neighbor each other. Another reason why this code/formula wouldn't work. 

 

 

coryanthony
7 - Meteor

Hey Andrew, the solution you provided looks identical to rzdodson with no edits. :)

flying008
14 - Magnetar

Hi, @coryanthony 

 

FYI.

1- Group by [Business Area] and [Profit Center] .

2- Expression:

 

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

 

3- Filter 0.

录制_2023_11_07_09_32_08_398.gif

 

 

Input           
DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit Center 
3080.01USD3080.01USD3080.0101/01/20234202312/15/2022827218200007 
-4106.68USD-4106.68USD-4106.6801/15/20234202301/13/2023827218200007 
4106.68USD4106.68USD4106.6802/01/20235202301/13/2023827218200007 
-5133.35USD-5133.35USD-5133.3502/15/20235202302/15/2023827218200007 
5133.35USD5133.35USD5133.3503/01/20236202302/15/2023827218200007 
-6160.02USD-6160.02USD-6160.0203/15/20236202303/15/2023827218200007 
-11293.37USD-11293.37USD-11293.3708/15/202311202308/11/2023827218200007 
11293.37USD11293.37USD11293.3708/15/202311202308/11/2023827918200008 
            
Output           
DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit CenterID
3080.01USD3080.01USD3080.0101/01/20234202312/15/20228272182000071
-6160.02USD-6160.02USD-6160.0203/15/20236202303/15/20238272182000071
-11293.37USD-11293.37USD-11293.3708/15/202311202308/11/20238272182000071
11293.37USD11293.37USD11293.3708/15/202311202308/11/20238279182000081
coryanthony
7 - Meteor

 

Well aren't you just amazing. This is brilliant.

 

One question: What happens the the debit does not neighbor the credit? If the offsetting amounts are not following each other, would this still work?

 

See input below. Thanks.

 

DC AmountLC CurrencyLC AmountGroup CurrencyGroup Currency AmtPosting DatePosting PeriodFiscal YearDoc. DateBusiness AreaProfit Center
3080.01USD3080.01USD3080.011/1/20234202312/15/2022827218200007
-4106.68USD-4106.68USD-4106.681/15/2023420231/13/2023827218200007
5133.35USD5133.35USD5133.352/1/2023620232/15/2023827218200007
4106.68USD4106.68USD4106.682/1/2023520232/28/2023827218200007
-6160.02USD-6160.02USD-6160.023/15/2023620233/15/2023827218200007
-11293.37USD-11293.37USD-11293.378/15/20231120238/11/2023827218200007
11293.37USD11293.37USD11293.378/15/20231120238/11/2023827918200008
-5133.35USD-5133.35USD-5133.358/15/2023520232/15/2023827218200007
Labels