Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Assign a number to the start of a group and all rows bewteen

hellyars
13 - Pulsar

Edited. 

 

Real data attached as YXZP.

 

Reference image below. 

 

I want to find each occurrence (row) that starts with the class below.

 

 

<div class="tcDtlSegFrame"...

 

 

As seen below, there are 6 occurrences.  I want to assign a number 1-6 to each respective occurrence and the corresponding number for all the rows between.

 

Alteryx_question_find_groups.png

 

 

 

 

4 REPLIES 4
gabrielvilella
14 - Magnetar

It is hard to provide a suggestion without the dataset. 

hellyars
13 - Pulsar

@gabrielvilella 

 

Added zip containing extracted h t m l and image of h t m l structure.  Note Frame = tcDtlSegFrame and so on.

hellyars
13 - Pulsar

I already isolated the relevant text by cutting everything above and below using a few Multi Row tools.

hellyars
13 - Pulsar

It is not elegant, but it works. 

 

  1. Created a field using the Formula tool to tag the relevant rows.

 

if startswith([Text],'<div class="tcDtlSegFrame"') then 1 else null() endif ​

 

  •  Filtered on the tagged rows to isolate the 6 relevant entries; used a second Record tool to create a new called Tag for each of the 6 entries.
  •  Joined everything back together and sorted on my original RecordID to get the rows back in order.
  • Extended the Tag to the null values between Tags.

 

if isnull([Tag]) then [Row-1:Tag] else [Tag] endif 

 

Screenshot 2022-02-07 171901.png

Labels