SOLVED
How to Split Up Data at Blank Rows?
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
abg5424
5 - Atom
‎04-19-2023
11:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am trying to assign a unique identifier to a group of rows, split up by blank spaces. Below is what I am trying to do:
Input | Desired Output |
A | ID1 |
B | ID1 |
C | ID1 |
ID1 | |
D | ID2 |
E | ID2 |
ID2 | |
F | ID3 |
ID3 |
Basically, what I was thinking was a while loop - while (current_row is not blank OR (current_row is blank AND following_row is not blank)) then keep same ID, else start using another ID. I tried using the multi-row formula tool, but was wondering if there are other intuitive ways to go about this (either using a macro or Python tool).
Thanks!
Solved! Go to Solution.
Labels:
- Labels:
- Best Practices
- Macros
- Python
2 REPLIES 2
MilindG
12 - Quasar
‎04-19-2023
12:30 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
17 - Castor
‎04-19-2023
12:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@abg5424 you're right to be thinking in terms of a Multi-Row Formula. Definitely the most intuitive way of doing this in Alteryx:
IF ISEMPTY([Row-1:Input]) THEN [Row-1:ID]+1 ELSE [Row-1:ID] ENDIF
