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

Alteryx Designer Desktop Discussions

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

Creating page numbers for preceding rows

Boha
6 - Meteoroid

Hi Team,

 

I have the following data:

 

DataParsed_Page_NumberTile_Num
Text1[Null]1
Text212
Text3[Null]1
Text422
Text5[Null]1
Text632
Text7[Null]1
Text842
Text9[Null]1
Text1052

 

 

and would want to create a new column ('Real_Page_Number') with page numbers driven off of  'Parsed_Page_Number' column. As you might have noticed, 'Parsed_Page_Number' with nulls belong to the same population of a page number following it. For example, Text1 and Text2 belong to page 1 even though 'Parsed_Page_Number' is null for Text1.

 

 

DataParsed_Page_NumberTile_NumReal_Page_Number
Text1[Null]11
Text2121
Text3[Null]12
Text4222
Text5[Null]13
Text6323
Text7[Null]14
Text8424
Text9[Null]15
Text10525

 

Many thanks in advance to anyone who will try to help!

4 REPLIES 4
Luke_C
17 - Castor
17 - Castor

Hi @Boha 

 

You can use a multi-row formula tool to help with this. I prepared a quick example for you. Essentially if the page number is null for the record, then it will look to the next record and take it's page value.

 

Luke_C_0-1617575602868.png

 

 

Boha
6 - Meteoroid

@Luke_C , appreciate your prompt response!

 

Even though your solution resolves my initially attached data set, my real data is a bit more complex - please see below.

 

DataParsed_Page_NumberTile_Num
Text1 1
Text2 1
Text3 1
Text4 1
Text5 1
Text6 1
Text7 1
Page 1 of 512
Text1 3
Text2 3
Text3 3
Text4 3
Text5 3
Text6 3
Text7 3
Text8 3
Text9 3
Text10 3
Text11 3
Text12 3
Text13 3
Text14 3
Page 2 of 524
Text1 5
Text2 5
Text3 5
Page 3 of 536
Text1 7
Text2 7
Text3 7
Page 4 of 548
Text1 9
Text2 9
Text3 9
Text4 9
Text5 9
Text6 9
Text7 9
Page 5 of 5510

 

Your solution updates only one row preceding the row that contains page data, such as below.

 

DataParsed_Page_NumberTile_NumReal_Page_Number
Text1 1 
Text2 1 
Text3 1 
Text4 1 
Text5 1 
Text6 1 
Text7 11
Page 1 of 5121
Text1 3 
Text2 3 
Text3 3 
Text4 3 
Text5 3 
Text6 3 
Text7 3 
Text8 3 
Text9 3 
Text10 3 
Text11 3 
Text12 3 
Text13 3 
Text14 32
Page 2 of 5242
Text1 5 
Text2 5 
Text3 53
Page 3 of 5363
Text1 7 
Text2 7 
Text3 74
Page 4 of 5484
Text1 9 
Text2 9 
Text3 9 
Text4 9 
Text5 9 
Text6 9 
Text7 95
Page 5 of 55105

 

However, I expect all of the rows preceding the row that contains page data to be updated.

 

DataParsed_Page_NumberTile_NumReal_Page_Number
Text1 11
Text2 11
Text3 11
Text4 11
Text5 11
Text6 11
Text7 11
Page 1 of 5121
Text1 32
Text2 32
Text3 32
Text4 32
Text5 32
Text6 32
Text7 32
Text8 32
Text9 32
Text10 32
Text11 32
Text12 32
Text13 32
Text14 32
Page 2 of 5242
Text1 53
Text2 53
Text3 53
Page 3 of 5363
Text1 74
Text2 74
Text3 74
Page 4 of 5484
Text1 95
Text2 95
Text3 95
Text4 95
Text5 95
Text6 95
Text7 95
Page 5 of 55105

 

Many thanks in advance!

afv2688
16 - Nebula
16 - Nebula

Hello @Boha ,

 

how about this solution?

 

Regards

Boha
6 - Meteoroid

You're the star - it works!

 

Another lesson learnt with Alteryx! 

 

Galaxy of thanks!

Labels
Top Solution Authors