Alteryx Designer Desktop Discussions

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

Mark intervals between an N and P flag with a buffer of X columns

John2275
5 - Atom

Hi all,

 

I have a data set with specific N and P flags in a column. I would like to isolate/mark (with a 1) the rows in between NP flag pairs only when the P flag occurs after a minimum of 6 rows, inclusive of the N flag row. Only an N flag after a P flag will create a new isolation interval.

 

 

ValueFlagMark
234N1
234 1
23N1
4P1
458 1
45 1
8P1
58  
567P 
...  
 N1
  1
 P1
  1
 N1
  1
 P1
   
 N1
  1
  1
  1
  1
 P1
  1
 P1

 

Any and all help would be appreciated. I tried using the filter tool with the multirow formula but I am having trouble figuring out the 6-row margin part. Thanks in advance!

2 REPLIES 2
Jay-RDC
8 - Asteroid

You should be able to accomplish that using a Record ID tool first then use the Record ID as reference for your formula.

Robin_McIntosh
11 - Bolide

Not sure if I'm following exactly what you're looking for but does this somewhat solve?  I acutally increment the mark and reset each interval.

Labels