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

How to get n consecutive data

ysreenumba
7 - Meteor

Hi All,

 

need help  to get first n consecutive data . so far n=3 the query return 6,7,8 . 

 

I have gone through similar kind of issue but not getting output.

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Count-consecutive-days/m-p/81996

 

 

CustIDStatus
1Login Failed
2Success
3Txn Error
4Login Failed
5Login Failed
6Txn Error
7Txn Error
8Txn Error
9Login Failed
10Login Failed
11Login Failed
12Login Failed
13Txn Error
14Success
15

Success

 

Thanks

Sreeni

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @ysreenumba 

 

Could you please detail this -  "get first n consecutive data . so far n=3 the query return 6,7,8 ."

 

Cheers,

danilang
19 - Altair
19 - Altair

Hi @ysreenumba 

 

I think this does what you're looking for

 

WF.png

 

The first formula is where you specify N, in this case 3.   Then add a Record ID.  Reverse the list based on the record ID.  Use a Multi-row tool to build up a list of sequences.  Then filter on all the records where the sequence number = N.  Get the Last one cause the list is reversed.  Append this Found record ID to the original list.  Restore the original order.  Select the records from the Found record ID to Found+N.  

 

The results are as follows

 

Results.png

 

 

Dan

 

Labels