Hello everyone!
I would appreciate some help with an especific problem I'm having.
The task is for alteryx to read an excel document like:
Field | Corresponding |
Date | Date_1 |
Name | Name_2 |
Amount | Amount_1 |
Details | - |
and 'select' the rows from a table like:
Date_1 | Date_2 | Name_1 | Name_2 | Amount_1 | Amount_2 | Details_1 | Details_2 |
4/4/2024 | 5/4/2024 | AAAA | BBBB | 50 | 30 | DDDD | EEE |
4/4/2024 | 5/4/2024 | AAAA | BBBB | 50 | 30 | BBB | EEE |
4/4/2024 | 5/4/2024 | AAAA | BBBB | 50 | 68 | BBB | EEE |
5/5/2024 | 6/4/2024 | BBBB | AAAA | 60 | 68 | BBB | CCC |
5/5/2024 | 6/4/2024 | BBBB | AAAA | 60 | 68 | XXX | CCC |
The output of this flux would have to be:
Date | Name | Amount | Details |
4/4/2024 | BBBB | 50 | |
4/4/2024 | BBBB | 50 | |
4/4/2024 | BBBB | 50 | |
5/5/2024 | AAAA | 60 | |
5/5/2024 | AAAA | 60 |
A detail is that this flux can't have an input from a user, I would like to build this into a macro.
I thank you all in advance!
Have a great day.
Solved! Go to Solution.
Hey @thirodrigues here's an approach that'll work for what you're after. In short the workflow:
1) Looks for the 'corresponding' fields and renames them to the target name
2) Cross-Tabs the 'lookup' of fields you want to keep, ready to use this as a template schema
3) Unions the two streams, only keeping like-for-like named columns i.e. those that you want
4) Does a second Union with the 'model schema' in order to add in any additional fields that you want but don't appear in the main data
Hope this helps!
It works! Thank you very much.