0

This might be a stupid question but is it possible to add multiple tables in ArcGIS Modelbuilder together? Just add 2 tables together, like a spreadsheet list without a common factor? I have been googling this for ages and all the methods seems to require some common factor?

For example:

Table 1: x | 2 z | 5

Table 2: a | 10 c | 13

Combined Supertable: x | 2 z | 5 a | 10 c | 13

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Apr 13, 2016 at 12:40
2
  • My dummy table failed, I tried to make it vertical but it got converted to horizontal. Commented Apr 14, 2016 at 7:47
  • Okay so I am almost done with my model. Currently I have 13 different tables as final output. Now I only need to merge all of them into 1 table (as I previosly asked about). Is this not possible in ArcGIS modelbuilder? Should I look into different methods, such as excel functions and/or python script? Commented Apr 18, 2016 at 12:08

1 Answer 1

1

Create an arbitrary common factor in each table. For example, in each table create a column called "Merge". Make it an integer short field. Now open the Calculate Field Tool. Click the expression box and in the code block insert the code below. In the Pre logic script code type: autoIncrement()

rec=0 
def autoIncrement(): 
 global rec 
 pStart = 1 
 pInterval = 1 
 if (rec == 0): 
 rec = pStart 
 else: 
 rec += pInterval 
 return rec

You could put this calculate field tool into your model, one for each table. Now, you could then use the Merge Tool and use this common arbitrary field. The code I gave you will populate the field in each table with incremental values in each row.

Without seeing your model, this is my first suggestion.

answered Apr 22, 2016 at 1:43
2
  • Thanks for reply! Yeah I was thinking about doing something along those lines, however 1 issue is the fact that not all of these tables that Im merging have the same columns. However I would still like to have the various tables stacked if possible. Hence I think this approach would bombard me with cells with "Null" values. Thoughts? Commented Apr 25, 2016 at 5:57
  • You say "the same columns", but do you mean the same number of columns? Commented Apr 25, 2016 at 12:56

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.