Generate new row and copy data from specified row above based on condition
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi guys, I'm new to Alteryx and couldn't figure out a way how to do this, maybe someone can help.
I have an input table that looks like the following:
Location (header) |
Berlin |
Berlin |
Munich |
Munich |
London |
London |
I'd like to generate a new row whenever there's a new location (active row does not equal row -1) and copy the data from the first row (header). The Output should look like this:
Location |
Berlin |
Berlin |
Location |
Munich |
Munich |
Location |
London |
London |
It would also be necessary to save every location in a new excel sheet (within the same workbook).
Thanks and kind regards!
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @snwk
If your end goal is to save the city names in different files, there is no need to populate the Location eachtime.
The header will be populated in the excel output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry, I forgot to specify this: There are basically 2 header rows, not 1. I managed to save it in different sheets, but of course the "second" header row is missing.
Location (header) |
2nd header |
Berlin |
Berlin |
Munich |
Munich |
London |
London |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @snwk
So you need both header in your output sheet?
Or only the 2nd header is enough in the output sheet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes, exactly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @snwk
Step 1: Input
Step 2:
Step 3:
IF [RecordID]<=2
THEN 0
ELSEIF [Location]=[Row-1:Location]
THEN 0
ELSE 1
ENDIF
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @snwk
Step 4: Formula tool
IF [Temp]="1"
THEN "2nd header"
ELSE [Temp]
ENDIF
Step 5:
Step 6:
Many thanks
Shanker V
