Hi Team,
I have the following data:
Data | Parsed_Page_Number | Tile_Num |
Text1 | [Null] | 1 |
Text2 | 1 | 2 |
Text3 | [Null] | 1 |
Text4 | 2 | 2 |
Text5 | [Null] | 1 |
Text6 | 3 | 2 |
Text7 | [Null] | 1 |
Text8 | 4 | 2 |
Text9 | [Null] | 1 |
Text10 | 5 | 2 |
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.
Data | Parsed_Page_Number | Tile_Num | Real_Page_Number |
Text1 | [Null] | 1 | 1 |
Text2 | 1 | 2 | 1 |
Text3 | [Null] | 1 | 2 |
Text4 | 2 | 2 | 2 |
Text5 | [Null] | 1 | 3 |
Text6 | 3 | 2 | 3 |
Text7 | [Null] | 1 | 4 |
Text8 | 4 | 2 | 4 |
Text9 | [Null] | 1 | 5 |
Text10 | 5 | 2 | 5 |
Many thanks in advance to anyone who will try to help!
Solved! Go to Solution.
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 , 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.
Data | Parsed_Page_Number | Tile_Num |
Text1 | 1 | |
Text2 | 1 | |
Text3 | 1 | |
Text4 | 1 | |
Text5 | 1 | |
Text6 | 1 | |
Text7 | 1 | |
Page 1 of 5 | 1 | 2 |
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 5 | 2 | 4 |
Text1 | 5 | |
Text2 | 5 | |
Text3 | 5 | |
Page 3 of 5 | 3 | 6 |
Text1 | 7 | |
Text2 | 7 | |
Text3 | 7 | |
Page 4 of 5 | 4 | 8 |
Text1 | 9 | |
Text2 | 9 | |
Text3 | 9 | |
Text4 | 9 | |
Text5 | 9 | |
Text6 | 9 | |
Text7 | 9 | |
Page 5 of 5 | 5 | 10 |
Your solution updates only one row preceding the row that contains page data, such as below.
Data | Parsed_Page_Number | Tile_Num | Real_Page_Number |
Text1 | 1 | ||
Text2 | 1 | ||
Text3 | 1 | ||
Text4 | 1 | ||
Text5 | 1 | ||
Text6 | 1 | ||
Text7 | 1 | 1 | |
Page 1 of 5 | 1 | 2 | 1 |
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 | 2 | |
Page 2 of 5 | 2 | 4 | 2 |
Text1 | 5 | ||
Text2 | 5 | ||
Text3 | 5 | 3 | |
Page 3 of 5 | 3 | 6 | 3 |
Text1 | 7 | ||
Text2 | 7 | ||
Text3 | 7 | 4 | |
Page 4 of 5 | 4 | 8 | 4 |
Text1 | 9 | ||
Text2 | 9 | ||
Text3 | 9 | ||
Text4 | 9 | ||
Text5 | 9 | ||
Text6 | 9 | ||
Text7 | 9 | 5 | |
Page 5 of 5 | 5 | 10 | 5 |
However, I expect all of the rows preceding the row that contains page data to be updated.
Data | Parsed_Page_Number | Tile_Num | Real_Page_Number |
Text1 | 1 | 1 | |
Text2 | 1 | 1 | |
Text3 | 1 | 1 | |
Text4 | 1 | 1 | |
Text5 | 1 | 1 | |
Text6 | 1 | 1 | |
Text7 | 1 | 1 | |
Page 1 of 5 | 1 | 2 | 1 |
Text1 | 3 | 2 | |
Text2 | 3 | 2 | |
Text3 | 3 | 2 | |
Text4 | 3 | 2 | |
Text5 | 3 | 2 | |
Text6 | 3 | 2 | |
Text7 | 3 | 2 | |
Text8 | 3 | 2 | |
Text9 | 3 | 2 | |
Text10 | 3 | 2 | |
Text11 | 3 | 2 | |
Text12 | 3 | 2 | |
Text13 | 3 | 2 | |
Text14 | 3 | 2 | |
Page 2 of 5 | 2 | 4 | 2 |
Text1 | 5 | 3 | |
Text2 | 5 | 3 | |
Text3 | 5 | 3 | |
Page 3 of 5 | 3 | 6 | 3 |
Text1 | 7 | 4 | |
Text2 | 7 | 4 | |
Text3 | 7 | 4 | |
Page 4 of 5 | 4 | 8 | 4 |
Text1 | 9 | 5 | |
Text2 | 9 | 5 | |
Text3 | 9 | 5 | |
Text4 | 9 | 5 | |
Text5 | 9 | 5 | |
Text6 | 9 | 5 | |
Text7 | 9 | 5 | |
Page 5 of 5 | 5 | 10 | 5 |
Many thanks in advance!
You're the star - it works!
Another lesson learnt with Alteryx!
Galaxy of thanks!
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |