I added gdb with input tool > Database connection > ESRI GeoDatabase > Quick connect
As a result, I got multiple tables. All tables have the same schema and I want to union all tables as one table. Here is an example screenshot but the real data has more than 50 tables. I want to avoid union using 50 input tools. What could be the most efficient and correct way to do this?
Solved! Go to Solution.
Hi @rewaza, you can build a batch macro to read all the tables. The control parameter will update the table name on each iteration. The attached workflow is just to get the idea, you will need to adjust the action tool to update the table name within the file. I don't have a gdb file here unfortunately.
Have you tried using a * wildcard in the connection?
In the real dataset, table names are absolutely different. Anyway, I tried but got an error: Error: Input Data (1): Can't find any file matching "gdb:C:\Users\Parcel*.gdb|||Parcels". Make sure the file path is correct.
The wildcard approach will not work since you need multiple tables within the same file. You need to do it with the macro as I mentioned.
Yes, right. I'm trying to find a way to pull table names from gdb. One solution is the python tool, with fiona.listlayers() which outputs the list of tables (layers) but I want to avoid using the python tool). I'll update comments if find a better solution. Thank you @gabrielvilella
Update: here is the python tool if any:
from ayx import Alteryx
import fiona
import pandas as pd
gdb = r"C:\test.gdb"
tl = fiona.listlayers(gdb)
tldf = pd.DataFrame(tl)
Alteryx.write(tldf,1)
This solution worked awesome. I was really struggling with this prior to your python solution. Thanks!