Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

how to delete rows

Sshasnk
8 - Asteroid

I have to delete the row which is coming after the word summary, but it should meet the condition

 

Input:

 

Field1
####123.54#21#INR
####Summary

####213,54.0123#TKU

####1453#Alex#458956
####Summary
####1452#USD
####7845#INR

 

Condition:

1. Condition is whenever I find a row which has a summary in it I have to delete the below rows till they have 5 # sings if it contains less than 5 signs then stop.

 

Output:

Field1
####123.54#21#INR
####1453#Alex#458956
2 REPLIES 2
PhilipMannering
16 - Nebula
16 - Nebula

Why does your output not include the last two records that have 5 # signs?

####1452#USD
####7845#INR
AkimasaKajitani
17 - Castor
17 - Castor

Would you mean that the Number of # is not 5 but 6?

 

I think that this is the workflow that you would need.

If you want to make a decision across the records, Multi-row formula is work well.

AkimasaKajitani_0-1607328699781.png

1st multi-row formula:

IF Contains([Row-1:Field1],"Summary") OR Contains([Field1],"Summary")  THEN "True" ELSE "False" ENDIF

At this tool, I marked the row contain "Summary" or the row that have it at the before record.

 

2nd multi-row formula:

IF [Row-1:IsDelete] AND REGEX_CountMatches([Field1], "#")>=6 THEN
"False"
ELSEIF [Row-1:IsDelete] AND REGEX_CountMatches([Field1], "#")<=5 THEN
"True"
ELSE
[IsDelete]
ENDIF

If the previous record is marked, count the number of #'s and re-mark it.

Labels
Top Solution Authors