SOLVED
How to count sequential groupings
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
ktberger_2020
7 - Meteor
‎09-11-2024
09:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can someone please help me figure out how to count the number of times a unique entity has a sequential count? It does not matter how long any sequence is, as long as it is 2 or more.
In the example below, the desired result for Customer 33359 would be a count of 3 and for Customer 12345, the count would be 2.
Store | Customer | PaymentRow |
C0299 | 33359 | 9 |
C0299 | 33359 | 10 |
C0299 | 33359 | 11 |
C0299 | 33359 | 22 |
C0299 | 33359 | 23 |
C0299 | 33359 | 31 |
C0299 | 33359 | 32 |
C0299 | 33359 | 33 |
C0299 | 12345 | 16 |
C0299 | 12345 | 17 |
C0299 | 12345 | 28 |
C0299 | 12345 | 29 |
Solved! Go to Solution.
Labels:
- Labels:
- Datasets
3 REPLIES 3
12 - Quasar
‎09-11-2024
12:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
A Multi-Row formula should work for this.
- I created a new column called "Sequential?" in the Multi-Row Tool.
- For the logic: if the Payment Row is 1 more than the Prior Row AND it's not 2 more than the 2-Prior Row, put 1. Otherwise put 0
- The "not 2 more" piece is so if you have 3 or more consecutive values, you get the 1 for the first set of consecutive values and then 0 after that, so you only count it once
- Summarize Tool to total up the "Sequential?" column
Note - I added a value for Customer 33359 with a row of 34 into your data to confirm it worked for 4 sequential numbers
 
nagakavyasri
12 - Quasar
‎09-17-2024
01:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎09-18-2024
02:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The multi row formula worked perfectly. Thank you.
