We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Counting the matches by sequence in one column

Chelle
6 - Meteoroid

I am trying to do a complex reconciliation where I would want to count the matches in a single column in which the matches is defined as the sum of the negative and positive amounts which is equal to zero, I already have the formula for that, I just don't how to count the matches in that single column, by skipping the column that do not have a match.

 

Here is the sample data:

 

Amount    

 15,000

-15,000

 17,000

 20,000

-20,000

 

This is my desired output: If amount  in row 1 + amount row 2 = 0 then matches column start to count 1 same as row 2 with the pair which is also 1 then if have found another pair of match would count in sequence, which is 2 so on and so forth.

 

Amount       Matches   

 15,000           1

-15,000           1

 17,000           [null] or [space]

 20,000           2

-20,000           2

 

1 REPLY 1
Chelle
6 - Meteoroid

Already solved 🙂

 

Chelle_0-1628904217401.png

IF [Row-1:Countervalue +/-]+[Countervalue +/-]=0

OR [Row+1:Countervalue +/-]+[Countervalue +/-]=0
THEN 1

ELSE NULL()
ENDIF

 

IF [Possible Matches] = NULL()
THEN [Row-1:New Field]

ELSE(
IF [Row-1:Possible Matches] = NULL()
THEN [Row-1:New Field]+1
ELSE
[Row-1:New Field]
ENDIF
)
ENDIF

 

IF [Possible Matches] != NULL()
THEN [New Field]
ELSE ""
ENDIF

Labels
Top Solution Authors