Hello All,
I have 2 tables one field is unique and 2 have different values. Now I need to merge them hence using union, while it generating the output , one table is giving Null value however value is there when looking at the input table.
Example below
Input
Table 1
Book PV_Jam
ABS 10
ASN 10
ASM 15
Table 2
Book PV_KAM
ABS 18
ASN 10
ASM 12
Output
Table 2
Book PV_JAM PV_KAM
ABS 10 Null
ASN 10 Null
ASM 12 Null
thanks for help !
Solved! Go to Solution.
Hey @aashutosh, if you want to merge the two tables, are you not meaning to Join them, rather than Union? A union is used to stack data on top of each other, whereas a Join will bring the two datasets side-by-side based on your condition (here, the unique 'Book' field):
If you do want the data on top of each other, you can Union them. You'll just need to Auto Config by Position (or Manually Configure Fields) so that you can force them to stack, as Alteryx by default will place fields with matching names on top of each other, but yours aren't identical. If you bruteforce them on top of one another with position/manual configuration, the field will keep the name of the dataset that goes on top (which you can decide in the bottom left of the Union configuration - 'Set a Specific Output Order').
Thanks !
I am building my first workflow (and not from coding background), this is helpful !
However, I am getting below ; how do I get rid off Right_Book
Book PV_JAM Right_Book PV_KAM
You can use the select tool to get rid of any column you do not want :)
No problem at all @aashutosh - glad to see you getting into Alteryx!
If you look at my screenshot above, you'll see that all of the fields are listed in the bottom of the Join tool configuration. This is all of the fields that will come out of the join once you run your workflow and you can edit these in the exact same way you use a Select tool. You can untick fields so they're not present in the output and you can also change the data type, size and rename said fields. In the answer I provided above, you'll see that I just unticked the 'Right_Book' field so that it doesn't come out in the input. When you're using the join tool, there'll always be duplicate field(s) as they're the unique key that you conduct the join on - by default, the second dataset will always be renamed to Right_FieldName. One easy way to remove these duplicate fields is to use the following dropdown:
And the 'Right_Book' field is automatically taken care of:
Basically, the section highlighted in red acts the same as a Select tool, so you don't need to use Join > Select.
Right, but above in the example from DataNath didn't used it still got the desired results. Just wanted to understand that..
Thanks for your reply !
User | Count |
---|---|
19 | |
15 | |
14 | |
9 | |
8 |