Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Identifying Sequential Numbers in a String

kelsey_kincaid
12 - Quasar

Hi all- I'm working on identifying financial accounts that might be 'Sample' accounts. I've been finding account numbers in my data like '123456' or '5678901' that I've confirmed with business users are indeed fictitious accounts used for testing purposes. What I would like to do is find a way to isolate the digits in these account numbers to test if they are sequential so I can review to see if they are testing/sample accounts. 

 

I'm thinking there's probably something I can do in RegEx to help me but I'm not very experienced with RegEx and am unsure where to start. I'm sure there's also a macro solution, but am feeling a little stuck overall. I would love guidance/opinions on the best approach and how to get started. Thank you in advance!

 

Account Number (Input)Is Sequential? (Desired Output)
Z5160FALSE
2345TRUE
7890123TRUE
012345TRUE
12345678TRUE
1589673FALSE
987654TRUE

 

12 REPLIES 12
fmvizcaino
17 - Castor
17 - Castor

@estherb47 , sure!!!

But seems like @DiegoParker owned us by far hahahahaha it took him 1318731 less tools than myself to accomplish the same. 

kelsey_kincaid
12 - Quasar

@fmvizcaino @estherb47 @DiegoParker @MarqueeCrew  Thank you all! I think these are all amazing solutions. This has been fun to think through, so I tossed the problem over to some of my colleagues as well and one of them came up with the solution below. Thought you might be interested to see yet another approach.

 

kayers_0-1580932610867.png

DiegoParker
10 - Fireball

@kelsey_kincaid As you well said you could do the descending in the same formula using an OR statement.

@fmvizcaino It was just a bit of luck! it just happened that the previous day I had been researching for a blog post about string functions so I had the content very fresh 😛

Labels