Alteryx Designer Desktop Discussions

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

Eliminate records based on condition

Shaaz
9 - Comet

Hi, Below is my data

 

Clr doc_#Clearing_DateInvoice_Amount
8521288920-Oct-14-205.34
8521288920-Oct-14-205.34
4820329295-Nov-14319.81
4820329295-Nov-14-319.81
8351811143-Nov-14331.65
25749518-Dec-14-10475.70
25749518-Dec-1410475.70
25749518-Dec-1410475.70
34389809819-Dec-142000.00
34389809819-Dec-14-1000.00
34389809819-Dec-14-1000.00
34389809819-Dec-14500.00
23709-Dec-1411132.00
23709-Dec-1420.00
33088-Oct-142000.00
33088-Oct-14-1000.00
33088-Oct-14-1000.00
12348-Oct-14-2000.00
12348-Oct-141000.00
12348-Oct-141000.00

 

Expected Output:

Clr doc_#Clearing_DateInvoice_AmountManual flag
8521288920-Oct-14-205.34I
8521288920-Oct-14-205.34I
8351811143-Nov-14331.65I
25749518-Dec-1410475.70I
34389809819-Dec-14500.00I
23709-Dec-1411132.00I
23709-Dec-1420.00I

 

Logic is groupby doc_num and date: eliminate those records where sum of amount of n rows for each doc# is zero

 

for Example: for doc_num 257495: we have 3 records but if we sum up invoice amount (-10475.70)+(10475.70)+(10475.70) = 10475.70, so instead of 3 records, I should get only one record that has data like below and create a column as Manual flag that has I=Include, E= Exclude

257495         18-Dec-14    10475.70     I

4 REPLIES 4
Shaaz
9 - Comet

Attached is the workflow that I tried but for a couple of line items I'm not getting expected output

mceleavey
17 - Castor
17 - Castor

Could you just clear why you want some to show as a single line and others to show as two lines?

For example, document 85212889 should show a single line of -410.68 but you want to show two lines of -205.34? What is the logic that differentiates this particular line?



Bulien

Shaaz
9 - Comet

Yes, I would like have two lines for doc num 85212889 because if we see the amount for that particular doc num both has -205.34, so if we add both the amounts sum is not zero.

 

I can give a scenario:

Bank pays to customer $100 by mistake with doc num A101 and on some date (Lets take 10/Aug/2017). Then Customer realises its by mistake, so Customer pays back to the bank $100 with same doc num A101 and on same date. So it is zero, neither a loss to bank nor to customer. So, I would like to eliminate these two records.

 

There could be chance where only bank pays to customer twice $100 but customer wont payback. In this case, I would like to have both the records in my dataset.

mceleavey
17 - Castor
17 - Castor

Ok, so I looked through it and determined that what you are trying to do is nett off invoices to credits, and so only nett off those where positive and negative values exist.

If there are only negative values, or only positive values, then show all rows.

I've attached the workflow which achieves this.

 

Let me know if this is correct or if I've misunderstood the logic.

 

 



Bulien

Labels